Browse Source

工资表数据、工资汇总数据、工资信息表导入

master
xuesinan 4 years ago
parent
commit
050afc435d
  1. 16
      src/App.vue
  2. 3
      src/config/api.js
  3. 333
      src/views/Salary/Salary.vue
  4. 25
      src/views/SalarySummary/SalarySummary.vue

16
src/App.vue

@ -17,13 +17,15 @@ export default {
}, },
async created() { async created() {
const userId = this.$route.query.uid; this.$router.onReady(async () => {
const roleId = this.$route.query.rid; const userId = this.$route.query.uid;
const params = { userId }; const roleId = this.$route.query.rid;
await this.getUserId(params); const params = { userId };
await this.setRoleId(roleId); await this.getUserId(params);
await this.getAllMembers({ projectId: this.$route.query.pid }); await this.setRoleId(roleId);
this.setProjectId(this.$route.query.pid); await this.getAllMembers({ projectId: this.$route.query.pid });
this.setProjectId(this.$route.query.pid);
});
}, },
methods: { methods: {

3
src/config/api.js

@ -19,3 +19,6 @@ export const clockExport = params => axios.post(`${defaultwbs}/clock/export`, pa
// 查询所有成员工资信息 // 查询所有成员工资信息
export const queryMemberSalary = params => axios.post(`${defaultwbs}/salary/queryMemberSalary`, params); export const queryMemberSalary = params => axios.post(`${defaultwbs}/salary/queryMemberSalary`, params);
// 查询某个员工工资
export const getMemberSalary = params => axios.post(`${defaultwbs}/salary/getMemberSalary`, params);

333
src/views/Salary/Salary.vue

@ -1,7 +1,7 @@
<template> <template>
<div class="salary-detail"> <div class="salary-detail">
<div class="salary-all text-center flex flex-col justify-center"> <div class="salary-all text-center flex flex-col justify-center">
<div class="salary-num white--text">5000.00</div> <div class="salary-num white--text">{{ Number(!salaryData.realSalary ? 0 : salaryData.realSalary).toFixed(2) }}</div>
<div class="salary-title font-12">实发金额</div> <div class="salary-title font-12">实发金额</div>
</div> </div>
@ -9,64 +9,176 @@
<div class="one-level mt-3 px-4 white"> <div class="one-level mt-3 px-4 white">
<div class="one-level-box flex justify-between items-center h-48 border-b"> <div class="one-level-box flex justify-between items-center h-48 border-b">
<div>固定工资</div> <div>固定工资</div>
<div class="flex items-center"> <div class="flex items-center" @click="isShow.isShow1 = isShow.isShow1 ? false : true">
<span>5000</span> <span>{{ !salaryData.fixedSalary ? 0 : salaryData.fixedSalary }}</span>
<!-- <a-icon class="icon" type="right" /> --> <a-icon v-if="!isShow.isShow1" class="icon" type="right" />
<a-icon class="icon" type="down" /> <a-icon v-else class="icon" type="down" />
</div> </div>
</div> </div>
<div class="two-level"> <template v-if="isShow.isShow1">
<div class="two-level-box flex justify-between items-center h-48 border-b"> <div class="two-level">
<div>基本工资</div> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div class="flex items-center"> <div>基本工资</div>
<span>4000</span> <div class="flex items-center" @click.stop="basicShow.isShow1 = basicShow.isShow1 ? false : true">
<!-- <a-icon class="icon" type="right" /> --> <span>{{ !fixedSalary.basicWage ? 0 : fixedSalary.basicWage }}</span>
<a-icon class="icon" type="down" /> <a-icon v-if="!basicShow.isShow1" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div>
<div class="three-level px-4" v-if="basicShow.isShow1">
<div class="three-level-box flex justify-between items-center h-48">
<div>应出勤天数</div>
<div class="flex items-center">
<span>{{ !basicSalary.shouldAttendanceDay ? 0 : basicSalary.shouldAttendanceDay }}</span>
</div>
</div>
<div class="three-level-box flex justify-between items-center h-48">
<div>实际出勤天数</div>
<div class="flex items-center">
<span>{{ !basicSalary.realAttendanceDay ? 0 : basicSalary.realAttendanceDay }}</span>
</div>
</div>
<div class="three-level-box flex justify-between items-center h-48">
<div>弹性天数</div>
<div class="flex items-center">
<span>{{ !basicSalary.elasticityDay ? 0 : basicSalary.elasticityDay }}</span>
</div>
</div>
<div class="three-level-box flex justify-between items-center h-48">
<div>请假天数</div>
<div class="flex items-center">
<span>{{ !basicSalary.askForLeaveDay ? 0 : basicSalary.askForLeaveDay }}</span>
</div>
</div>
</div>
</div>
<div class="two-level">
<div class="two-level-box flex justify-between items-center h-48 border-b">
<div>岗位工资</div>
<div class="flex items-center" @click.stop="basicShow.isShow2 = basicShow.isShow2 ? false : true">
<span>{{ !fixedSalary.positionWage ? 0 : fixedSalary.positionWage }}</span>
<a-icon v-if="!basicShow.isShow2" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div> </div>
<div class="three-level px-4" v-if="basicShow.isShow2 && positionSalary">
<div class="three-level-box flex justify-between items-center h-48" v-for="(val, key) in positionSalary" :key="key">
<div>{{ key }}</div>
<div class="flex items-center">
<span>{{ val }}</span>
</div>
</div>
</div>
</div>
<div class="two-level">
<div class="two-level-box flex justify-between items-center h-48 border-b">
<div>工龄工资</div>
<div class="flex items-center" @click.stop="basicShow.isShow3 = basicShow.isShow3 ? false : true">
<span>{{ !fixedSalary.workingTimeWage ? 0 : fixedSalary.workingTimeWage }}</span>
<a-icon v-if="!basicShow.isShow3" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div>
<div class="three-level px-4" v-if="basicShow.isShow3 && workingTimeSalary">
<div class="three-level-box flex justify-between items-center h-48" v-for="(val, key) in workingTimeSalary" :key="key">
<div>{{ key }}</div>
<div class="flex items-center">
<span>{{ val }}</span>
</div>
</div>
</div>
</div>
</template>
</div>
<div class="one-level mt-3 px-4 white" @click.stop="isShow.isShow2 = isShow.isShow2 ? false : true">
<div class="one-level-box flex justify-between items-center h-48 border-b">
<div>绩效收入</div>
<div class="flex items-center">
<span>{{ !salaryData.performance ? 0 : salaryData.performance }}</span>
<a-icon v-if="!isShow.isShow2" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div> </div>
</div>
<div class="three-level px-4"> <template v-if="isShow.isShow2">
<div class="three-level-box flex justify-between items-center h-48"> <div class="two-level">
<div>应出勤天数</div> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div class="flex items-center"><span>22</span></div> <div>360考核</div>
<div class="flex items-center" @click.stop="performanceShow.isShow1 = performanceShow.isShow1 ? false : true">
<span>{{ !performanceSalary.assess ? 0 : performanceSalary.assess }}</span>
<a-icon v-if="!performanceShow.isShow1" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div> </div>
</div>
<div class="three-level-box flex justify-between items-center h-48"> <div class="two-level">
<div>实际出勤天数</div> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div class="flex items-center"><span>18</span></div> <div>项目奖金</div>
<div class="flex items-center" @click.stop="performanceShow.isShow2 = performanceShow.isShow2 ? false : true">
<span>{{ !performanceSalary.projectBonus ? 0 : performanceSalary.projectBonus }}</span>
<a-icon v-if="!performanceShow.isShow2" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div> </div>
</div>
<div class="three-level-box flex justify-between items-center h-48"> <div class="two-level">
<div>弹性天数</div> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div class="flex items-center"><span>2</span></div> <div>提成</div>
<div class="flex items-center" @click.stop="performanceShow.isShow3 = performanceShow.isShow3 ? false : true">
<span>{{ !performanceSalary.pushMoney ? 0 : performanceSalary.pushMoney }}</span>
<a-icon v-if="!performanceShow.isShow3" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div> </div>
</div>
<div class="three-level-box flex justify-between items-center h-48"> <div class="two-level">
<div>请假天数</div> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div class="flex items-center"><span>2</span></div> <div>补助</div>
<div class="flex items-center" @click.stop="performanceShow.isShow4 = performanceShow.isShow4 ? false : true">
<span>{{ !performanceSalary.subsidy ? 0 : performanceSalary.subsidy }}</span>
<a-icon v-if="!performanceShow.isShow4" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div> </div>
</div> </div>
</template>
</div>
<div class="one-level mt-3 px-4 white">
<div class="one-level-box flex justify-between items-center h-48 border-b">
<div>主人翁收入</div>
<div class="flex items-center" @click="isShow.isShow3 = isShow.isShow3 ? false : true">
<span>{{ !salaryData.stockRights ? 0 : salaryData.stockRights }}</span>
<a-icon v-if="!isShow.isShow3" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div>
</div> </div>
<div class="two-level"> <div class="two-level" v-if="isShow.isShow3">
<div class="two-level-box flex justify-between items-center h-48 border-b"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div>岗位工资</div> <div>期权置换</div>
<div class="flex items-center"> <div class="flex items-center">
<span>500</span> <span>{{ !stockRightsSalary.sharePtion ? 0 : stockRightsSalary.sharePtion }}</span>
<a-icon class="icon" type="right" />
<!-- <a-icon class="icon" type="down" /> -->
</div> </div>
</div> </div>
</div>
<div class="two-level">
<div class="two-level-box flex justify-between items-center h-48 border-b"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div>工龄工资</div> <div>分红</div>
<div class="flex items-center"> <div class="flex items-center">
<span>500</span> <span>{{ !stockRightsSalary.receiveDividends ? 0 : stockRightsSalary.receiveDividends }}</span>
<a-icon class="icon" type="right" />
<!-- <a-icon class="icon" type="down" /> -->
</div> </div>
</div> </div>
</div> </div>
@ -74,65 +186,63 @@
<div class="one-level mt-3 px-4 white"> <div class="one-level mt-3 px-4 white">
<div class="one-level-box flex justify-between items-center h-48 border-b"> <div class="one-level-box flex justify-between items-center h-48 border-b">
<div>固定工资</div> <div>应发工资</div>
<div class="flex items-center"> <div class="flex items-center">
<span>5000</span> <span>{{ !salaryData.shouldSalary ? 0 : salaryData.shouldSalary }}</span>
<!-- <a-icon class="icon" type="right" /> --> </div>
<a-icon class="icon" type="down" /> </div>
</div>
<div class="one-level mt-3 px-4 white">
<div class="one-level-box flex justify-between items-center h-48 border-b">
<div>社保支出</div>
<div class="flex items-center" @click="isShow.isShow4 = isShow.isShow4 ? false : true">
<span>{{ !salaryData.socialSecurity ? 0 : salaryData.socialSecurity }}</span>
<a-icon v-if="!isShow.isShow4" class="icon" type="right" />
<a-icon v-else class="icon" type="down" />
</div> </div>
</div> </div>
<div class="two-level"> <div class="two-level" v-if="isShow.isShow4">
<div class="two-level-box flex justify-between items-center h-48 border-b"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div>基本工资</div> <div>医疗保险</div>
<div class="flex items-center"> <div class="flex items-center">
<span>4000</span> <span>{{ !socialSecuritySalary.medicalInsurance ? 0 : socialSecuritySalary.medicalInsurance }}</span>
<!-- <a-icon class="icon" type="right" /> -->
<a-icon class="icon" type="down" />
</div> </div>
</div> </div>
<div class="three-level px-4"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div class="three-level-box flex justify-between items-center h-48"> <div>生育保险</div>
<div>应出勤天数</div> <div class="flex items-center">
<div class="flex items-center"><span>22</span></div> <span>{{ !socialSecuritySalary.maternityInsurance ? 0 : socialSecuritySalary.maternityInsurance }}</span>
</div>
<div class="three-level-box flex justify-between items-center h-48">
<div>实际出勤天数</div>
<div class="flex items-center"><span>18</span></div>
</div> </div>
</div>
<div class="three-level-box flex justify-between items-center h-48"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div>弹性天数</div> <div>工伤保险</div>
<div class="flex items-center"><span>2</span></div> <div class="flex items-center">
<span>{{ !socialSecuritySalary.employmentInjuryInsurance ? 0 : socialSecuritySalary.employmentInjuryInsurance }}</span>
</div> </div>
</div>
<div class="three-level-box flex justify-between items-center h-48"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div>请假天数</div> <div>养老保险</div>
<div class="flex items-center"><span>2</span></div> <div class="flex items-center">
<span>{{ !socialSecuritySalary.endowmentInsurance ? 0 : socialSecuritySalary.endowmentInsurance }}</span>
</div> </div>
</div> </div>
</div>
<div class="two-level">
<div class="two-level-box flex justify-between items-center h-48 border-b"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div>岗位工资</div> <div>失业保险</div>
<div class="flex items-center"> <div class="flex items-center">
<span>500</span> <span>{{ !socialSecuritySalary.unemploymentInsurance ? 0 : socialSecuritySalary.unemploymentInsurance }}</span>
<a-icon class="icon" type="right" />
<!-- <a-icon class="icon" type="down" /> -->
</div> </div>
</div> </div>
</div>
<div class="two-level">
<div class="two-level-box flex justify-between items-center h-48 border-b"> <div class="two-level-box flex justify-between items-center h-48 border-b">
<div>工龄工资</div> <div>住房公积金</div>
<div class="flex items-center"> <div class="flex items-center">
<span>500</span> <span>{{ !socialSecuritySalary.housingFund ? 0 : socialSecuritySalary.housingFund }}</span>
<a-icon class="icon" type="right" />
<!-- <a-icon class="icon" type="down" /> -->
</div> </div>
</div> </div>
</div> </div>
@ -140,11 +250,18 @@
<div class="one-level mt-3 px-4 white"> <div class="one-level mt-3 px-4 white">
<div class="one-level-box flex justify-between items-center h-48 border-b"> <div class="one-level-box flex justify-between items-center h-48 border-b">
<div>绩效收入</div> <div>扣税</div>
<div class="flex items-center">
<span>{{ !salaryData.personalTax ? 0 : salaryData.personalTax }}</span>
</div>
</div>
</div>
<div class="one-level mt-3 px-4 white">
<div class="one-level-box flex justify-between items-center h-48 border-b">
<div>实发工资</div>
<div class="flex items-center"> <div class="flex items-center">
<span>1000</span> <span>{{ !salaryData.realSalary ? 0 : salaryData.realSalary }}</span>
<a-icon class="icon" type="right" />
<!-- <a-icon class="icon" type="down" /> -->
</div> </div>
</div> </div>
</div> </div>
@ -162,15 +279,54 @@
</template> </template>
<script> <script>
import { mapState } from 'vuex';
import { getMemberSalary } from '@/config/api';
export default { export default {
data() { data() {
return { return {
ModalText: '', ModalText: '',
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
salaryData: {},
fixedSalary: {}, //
basicSalary: {}, //
positionSalary: {}, //
workingTimeSalary: {}, //
performanceSalary: {}, //
socialSecuritySalary: {}, //
stockRightsSalary: {}, //
isShow: {
isShow1: false,
isShow2: false,
isShow3: false,
isShow4: false,
},
basicShow: {
isShow1: false,
isShow2: false,
isShow3: false,
},
performanceShow: {
isShow1: false,
isShow2: false,
isShow3: false,
isShow4: false,
},
}; };
}, },
computed: mapState('home', ['projectId', 'roleId']),
mounted() {
this.timer = setInterval(async () => {
if (this.projectId) {
clearInterval(this.timer);
await this.getMemberSalary();
}
}, 300);
},
methods: { methods: {
showModal() { showModal() {
this.visible = true; this.visible = true;
@ -188,6 +344,31 @@ export default {
handleCancel(e) { handleCancel(e) {
this.visible = false; this.visible = false;
}, },
//
async getMemberSalary() {
const params = { param: { projectId: this.projectId } };
try {
const res = await getMemberSalary(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.salaryData = data;
this.fixedSalary = data.fixedSalaryOption; //
this.basicSalary = data.fixedSalaryOption.basic; // --
this.positionSalary = data.fixedSalaryOption.position; //
this.workingTimeSalary = data.fixedSalaryOption.workingTime; //
this.performanceSalary = data.performanceOption; //
this.socialSecuritySalary = data.socialSecurityOption; //
this.stockRightsSalary = data.stockRightsOption; //
} else {
this.$message.error(msg || '获取失败');
throw msg;
}
} catch (error) {
throw error || '获取失败';
}
},
}, },
}; };
</script> </script>

25
src/views/SalarySummary/SalarySummary.vue

@ -263,6 +263,7 @@ export default {
], ],
monthStartTime: '', monthStartTime: '',
monthEndTime: '', monthEndTime: '',
dataSalary: [],
}; };
}, },
@ -338,22 +339,26 @@ export default {
// //
async getQueryMemberSalary() { async getQueryMemberSalary() {
const params = { param: { projectId, startTime: this.monthStartTime, endTime: this.monthEndTime } }; const params = { param: { projectId: this.projectId, startTime: this.monthStartTime, endTime: this.monthEndTime } };
try { try {
const res = await queryMemberSalary(params); const res = await queryMemberSalary(params);
const { code, msg, data } = res.data; const { code, msg, data } = res.data;
if (code === 200) { if (code === 200) {
data.forEach(item => { let dataSalary = [];
item.recordList.forEach(clcok => { data.forEach((item, index) => {
clcok.morningVisible = false; let obj = {};
clcok.nightVisible = false; obj.key = index + 1;
clcok.showNightTime = false; obj.name = item.memberName;
clcok.showMorningTime = false; obj.salary = item.realSalary;
}); obj.department = '技术';
obj.position = '前端';
obj.payrollCard = '111111111111111111';
dataSalary.push(obj);
}); });
console.log(dataSalary);
this.clockInfos = [...data]; this.data_all = dataSalary;
} else { } else {
this.$message.error(msg || '获取失败'); this.$message.error(msg || '获取失败');
throw msg; throw msg;

Loading…
Cancel
Save