|
|
|
|
@ -12,6 +12,7 @@
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-input size="small" style="width:250px;margin-left:6px" v-model="select.keyword" placeholder="请输入关键词"></el-input>
|
|
|
|
|
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getStatistics">搜索</el-button>
|
|
|
|
|
<el-button type="success" plain size="small" style="margin-left: 6px;" @click="openConfirmDialog">批量审核</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-toolbar>
|
|
|
|
|
<vxe-table
|
|
|
|
|
@ -37,6 +38,13 @@
|
|
|
|
|
width="120">
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="department.name" title="所在部门" align="center" width="150"></vxe-column>
|
|
|
|
|
<vxe-column field="reviewer.name" title="审核人" align="center" width="120"></vxe-column>
|
|
|
|
|
<vxe-column title="审核时间" align="center" width="170">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
{{ row.reviewed_at ? $moment(row.reviewed_at).format('YYYY-MM-DD HH:mm:ss') : '' }}
|
|
|
|
|
</template>
|
|
|
|
|
</vxe-column>
|
|
|
|
|
<vxe-column field="review_remark" title="审核备注" align="center" min-width="150"></vxe-column>
|
|
|
|
|
<vxe-colgroup v-for="item in dateTableColumns" align="center" :title="item.title">
|
|
|
|
|
<vxe-column title="上午" width="160" align="center">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
@ -94,12 +102,59 @@
|
|
|
|
|
</vxe-column>
|
|
|
|
|
</vxe-table>
|
|
|
|
|
</card-container>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="批量审核"
|
|
|
|
|
:visible.sync="confirmVisible"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
width="480px"
|
|
|
|
|
@closed="resetConfirmForm"
|
|
|
|
|
>
|
|
|
|
|
<el-form ref="confirmForm" :model="confirmForm" :rules="confirmRules" label-width="80px">
|
|
|
|
|
<el-form-item label="部门" prop="department_id">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="confirmForm.department_id"
|
|
|
|
|
:disabled="!is_bgs"
|
|
|
|
|
placeholder="请选择部门"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in confirmDepartments"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="月份" prop="month">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="confirmForm.month"
|
|
|
|
|
type="month"
|
|
|
|
|
value-format="yyyy-MM"
|
|
|
|
|
placeholder="请选择月份"
|
|
|
|
|
style="width: 100%;"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="review_remark">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="confirmForm.review_remark"
|
|
|
|
|
type="textarea"
|
|
|
|
|
:rows="3"
|
|
|
|
|
placeholder="请输入备注"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="confirmVisible = false">取消</el-button>
|
|
|
|
|
<el-button type="primary" :loading="confirmLoading" @click="submitConfirm">确定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { throttle } from '@/utils'
|
|
|
|
|
import { statistics } from '@/api/attendance'
|
|
|
|
|
import { statistics, statisticsConfirm } from '@/api/attendance'
|
|
|
|
|
import {
|
|
|
|
|
departmentListNoAuth
|
|
|
|
|
} from "@/api/common.js"
|
|
|
|
|
@ -119,7 +174,18 @@ export default {
|
|
|
|
|
dates: [],
|
|
|
|
|
leave_types: []
|
|
|
|
|
},
|
|
|
|
|
my_department_id:''
|
|
|
|
|
my_department_id:'',
|
|
|
|
|
confirmVisible: false,
|
|
|
|
|
confirmLoading: false,
|
|
|
|
|
confirmForm: {
|
|
|
|
|
department_id: '',
|
|
|
|
|
month: '',
|
|
|
|
|
review_remark: ''
|
|
|
|
|
},
|
|
|
|
|
confirmRules: {
|
|
|
|
|
department_id: [{ required: true, message: '请选择部门', trigger: 'change' }],
|
|
|
|
|
month: [{ required: true, message: '请选择月份', trigger: 'change' }]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
@ -138,6 +204,41 @@ export default {
|
|
|
|
|
console.error(err)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
openConfirmDialog() {
|
|
|
|
|
this.confirmForm = {
|
|
|
|
|
department_id: this.my_department_id,
|
|
|
|
|
month: this.select.month,
|
|
|
|
|
review_remark: ''
|
|
|
|
|
}
|
|
|
|
|
this.confirmVisible = true
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.confirmForm && this.$refs.confirmForm.clearValidate()
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
resetConfirmForm() {
|
|
|
|
|
this.confirmForm = {
|
|
|
|
|
department_id: '',
|
|
|
|
|
month: '',
|
|
|
|
|
review_remark: ''
|
|
|
|
|
}
|
|
|
|
|
this.$refs.confirmForm && this.$refs.confirmForm.resetFields()
|
|
|
|
|
},
|
|
|
|
|
submitConfirm() {
|
|
|
|
|
this.$refs.confirmForm.validate(async valid => {
|
|
|
|
|
if (!valid) return
|
|
|
|
|
try {
|
|
|
|
|
this.confirmLoading = true
|
|
|
|
|
await statisticsConfirm(this.confirmForm)
|
|
|
|
|
this.$message.success('审核成功')
|
|
|
|
|
this.confirmVisible = false
|
|
|
|
|
await this.getStatistics()
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.error(err)
|
|
|
|
|
} finally {
|
|
|
|
|
this.confirmLoading = false
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async getDepartmentList() {
|
|
|
|
|
try {
|
|
|
|
|
const res = await departmentListNoAuth();
|
|
|
|
|
@ -241,6 +342,16 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
workDates() {
|
|
|
|
|
return this.tableData.dates.filter(i => i.is_workday).map(i => i.date)
|
|
|
|
|
},
|
|
|
|
|
confirmDepartments() {
|
|
|
|
|
if (this.is_bgs) {
|
|
|
|
|
return this.departments.filter(item => item.id !== '')
|
|
|
|
|
}
|
|
|
|
|
const dept = store.state.department
|
|
|
|
|
if (dept && dept.id) {
|
|
|
|
|
return [{ id: dept.id, name: dept.name }]
|
|
|
|
|
}
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
|