|
@@ -0,0 +1,91 @@
|
|
|
+<template>
|
|
|
+ <div class="pa-3 white">
|
|
|
+ <m-search class="mb-3" :items="searchItems" v-model="searchValues" @search="onSearch"></m-search>
|
|
|
+ <m-card v-loading="loading">
|
|
|
+ <template #header>
|
|
|
+ {{ $route.meta.title }}
|
|
|
+ </template>
|
|
|
+ <m-empty v-if="!item"></m-empty>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <el-descriptions :column="2" border>
|
|
|
+ <el-descriptions-item
|
|
|
+ v-for="header in headers"
|
|
|
+ :key="header.prop"
|
|
|
+ :label="header.label"
|
|
|
+ >
|
|
|
+ {{ item[header.prop] }}
|
|
|
+ </el-descriptions-item>
|
|
|
+ </el-descriptions>
|
|
|
+ </template>
|
|
|
+ </m-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ getPayrollPage
|
|
|
+} from '@/api/salary'
|
|
|
+import { dateFormat } from '@/utils/date'
|
|
|
+import {
|
|
|
+ PAYROLL_HEADER
|
|
|
+} from '@/utils/panorama'
|
|
|
+export default {
|
|
|
+ name: 'StaffWageMine',
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ headers: PAYROLL_HEADER,
|
|
|
+ loading: false,
|
|
|
+ item: null,
|
|
|
+ searchValues: {
|
|
|
+ month: dateFormat('YYYY-mm', new Date())
|
|
|
+ },
|
|
|
+ searchItems: [
|
|
|
+ {
|
|
|
+ label: '月份',
|
|
|
+ prop: 'month',
|
|
|
+ type: 'datePicker',
|
|
|
+ options: {
|
|
|
+ placeholder: '请选择月份',
|
|
|
+ type: 'month',
|
|
|
+ valueFormat: 'yyyy-MM',
|
|
|
+ format: 'yyyy 年 MM 月'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.onInit()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ async onInit () {
|
|
|
+ this.loading = true
|
|
|
+ try {
|
|
|
+ const { data } = await getPayrollPage({
|
|
|
+ entity: {
|
|
|
+ unifiedCertificationNumber: this.$store.getters.userInfo.employeeCode,
|
|
|
+ ...this.searchValues
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (!data.records.length) {
|
|
|
+ this.item = null
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.item = data.records.pop()
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ } finally {
|
|
|
+ this.loading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSearch () {
|
|
|
+ this.onInit()
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+
|
|
|
+</style>
|