轮休外出办事异常

This commit is contained in:
jjLv 2024-10-12 13:12:51 +08:00
parent 292b5c1ed1
commit 632a7e3313
4 changed files with 160 additions and 50 deletions

View File

@ -38,3 +38,12 @@ export function exportExceptionError(query) {
})
}
// 审批提醒
export function examineRemind(data) {
return request({
url: '/system/attExceptionHandle/examineRemind',
method: 'post',
data: data
})
}

View File

@ -5,20 +5,13 @@
<el-date-picker
v-model="queryParams.attCurrentMonth"
style="width: 240px"
placeholder="请选择选择月份"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM"
></el-date-picker>
</el-form-item>
<el-form-item label="部门" prop="orgName">
<el-select v-model="queryParams.orgName" placeholder="选择部门" clearable style="width: 100%;">
<el-option
v-for="dict in dict.type.sys_voltage_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-form-item label="部门" prop="orgId">
<treeselect v-model="queryParams.orgId" :options="deptOptions" :normalizer="normalizer" @select="handleSelect" placeholder="选择部门" style="width: 240px"/>
</el-form-item>
<el-form-item label="姓名:" prop="name">
<el-input
@ -50,7 +43,6 @@
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="编号" align="center" prop="id" v-if="false" />
<el-table-column label="姓名" align="center" prop="name" sortable/>
<el-table-column label="所属部门" align="center" prop="orgName" sortable/>
<el-table-column label="应出勤天数" align="center" prop="requiredDays" sortable/>
@ -210,23 +202,24 @@
<script>
import { listMonthlyError,getDetail,exportMonthlyError} from "@/api/attendanceReport/monthlyError";
import { listDept, getDept, delDept, addDept, updateDept,orgPersonSelect } from "@/api/system/dept";
import { listDept } from "@/api/system/dept";
import { downloadFile } from '@/utils/download'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
// import { getEngineeringList } from "@/api/select";
import { getToken } from '@/utils/auth'
export default {
name: "Post",
dicts: ['sys_normal_disable','sys_voltage_level','sys_org_name','sys_pro_type','sys_pro_status',
'sys_yz_manage','sys_sg_manage','sys_jl_manage','sys_device_type'],
components: {
},
// dicts: ['sys_normal_disable','sys_voltage_level','sys_org_name','sys_pro_type','sys_pro_status',
// 'sys_yz_manage','sys_sg_manage','sys_jl_manage','sys_device_type'],
components: { Treeselect },
data() {
return {
showAttribute:false,
//
loading: true,
loading: false,
//
loadingTwo: true,
loadingTwo: false,
//
ids: [],
//
@ -260,6 +253,7 @@
attCurrentMonth:undefined,
name:undefined,
orgName: undefined,
orgId: undefined,
},
queryRecord: {
@ -294,13 +288,27 @@
return `${year}-${month}-${day} ${weekday}`; //
},
/** 查询部门列表 */
getDeptList() {
this.loading = true;
listDept().then(response => {
this.deptList = this.handleTree(response.data, "id");
this.loading = false;
});
getDeptList(){
listDept().then(response => {
this.deptOptions = this.handleTree(response.data, "id");
});
},
/** 转换部门数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.orgName,
children: node.children
};
},
handleSelect(value, instanceId) {
console.log('Selected:', value);
//
this.queryParams.orgName=value.orgName;
},
/** 查询月异常列表 */
@ -333,7 +341,6 @@
this.getListRecord();
},
//
openRecord(row,titleBoss){
this.id = row.id;

View File

@ -3,11 +3,13 @@
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="选择月份:" prop="attCurrentMonth">
<el-date-picker
v-model="queryParams.attCurrentMonth"
v-model="searchAttCurrentMonth"
style="width: 240px"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM"
@change="handleChange"
:clearable="false"
></el-date-picker>
</el-form-item>
@ -153,6 +155,7 @@
showSearch: true,
showRecord:false,
maxLength:100,//
searchAttCurrentMonth: undefined,
//
total: 0,
totalTwo: 0,
@ -195,11 +198,30 @@
computed: {
},
created() {
const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1)
this.searchAttCurrentMonth = lastMonth;
this.getList();
},
mounted(){
},
methods: {
handleChange(newValue) {
//
if (!newValue) {
console.log(newValue)
const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1)
this.searchAttCurrentMonth = lastMonth;
this.getList();
}
},
formatDateTwo(dateString) {
const date = new Date(dateString)
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0'); //
return `${year}-${month}`;
},
formatDate(dateString){
const date = new Date(dateString); //
const year = date.getFullYear(); //
@ -214,6 +236,8 @@
/** 查询月异常列表 */
getList() {
this.loading = true;
this.queryParams.attCurrentMonth = this.formatDateTwo(this.searchAttCurrentMonth);
console.log(this.queryParams.attCurrentMonth)
listExceptionDataError(this.queryParams).then(response => {
this.tableData = response.rows;
this.total = response.total;

View File

@ -5,20 +5,14 @@
<el-date-picker
v-model="searchAttCurrentMonth"
style="width: 240px"
placeholder="请选择选择月份"
placeholder="请选择月份"
type="month"
value-format="yyyy-MM"
:clearable="false"
></el-date-picker>
</el-form-item>
<el-form-item label="部门:" prop="orgName">
<el-select v-model="queryParams.orgName" placeholder="选择部门" clearable style="width: 100%;">
<el-option
v-for="dict in dict.type.sys_voltage_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-form-item label="部门" prop="orgId">
<treeselect v-model="queryParams.orgId" :options="deptOptions" :normalizer="normalizer" @select="handleSelect" placeholder="选择部门" style="width: 240px"/>
</el-form-item>
<el-form-item label="姓名:" prop="name">
<el-input
@ -87,7 +81,7 @@
<el-form :model="queryRecord" ref="queryFormRecord" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="姓名:" prop="name">
<el-input
v-model="queryParams.name"
v-model="queryRecord.name"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQueryRecord"
@ -146,17 +140,17 @@
<!-- 审批提醒对话框 -->
<el-dialog :title="titleExamine" :visible.sync="openExamine" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" >
<el-form-item prop="remarksExamine">
<el-form-item prop="content">
<el-input
type="textarea"
:rows="5"
placeholder="请输入"
v-model="form.remarksExamine"
v-model="form.content"
maxlength="50"
show-word-limit
>
</el-input>
<!-- <el-input v-model="form.remarksExamine" placeholder="请输入" maxlength="20"/> -->
<!-- <el-input v-model="form.content" placeholder="请输入" maxlength="20"/> -->
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -168,15 +162,19 @@
</template>
<script>
import { listExceptionFormError,getDetailExceptionRest,getDetailExceptionOut,exportExceptionError} from "@/api/exceptionHandle/errorForm";
import { listExceptionFormError,getDetailExceptionRest,getDetailExceptionOut,exportExceptionError,examineRemind} from "@/api/exceptionHandle/errorForm";
import { downloadFile } from '@/utils/download'
// import { getEngineeringList } from "@/api/select";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listDept } from "@/api/system/dept";
import { getToken } from '@/utils/auth'
export default {
name: "Post",
dicts: ['sys_normal_disable','sys_voltage_level','sys_org_name','sys_pro_type','sys_pro_status',
'sys_yz_manage','sys_sg_manage','sys_jl_manage','sys_device_type'],
components: {
Treeselect
},
data() {
return {
@ -188,6 +186,7 @@
//
ids: [],
//
deptOptions: [],
showSearch: true,
showRecord:false,
maxLength:100,//
@ -224,14 +223,25 @@
attCurrentMonth: undefined,
},
//
form:{},
form:{
orgId: undefined,
content: undefined,
title: undefined,
},
//
rules: {
content: [
{ required: true, message: "补充内容不能为空", trigger: "blur" }
],
},
};
},
computed: {
},
created() {
this.getDeptList();
// `attCurrentMonth`
if (this.$route.query.attCurrentMonth) {
// `attCurrentMonth`
@ -239,8 +249,11 @@
// this.queryParams.attCurrentMonth = this.$route.query.attCurrentMonth;
this.getList();
} else {
const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1)
this.searchAttCurrentMonth = lastMonth;
//
this.searchAttCurrentMonth = '';
// this.searchAttCurrentMonth = '';
// this.queryParams.attCurrentMonth = '';
this.getList();
}
@ -268,6 +281,22 @@
// },
methods: {
handleChange(newValue) {
//
if (!newValue) {
console.log(newValue)
const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1)
this.searchAttCurrentMonth = lastMonth;
this.getList();
}
},
formatDateTwo(dateString) {
const date = new Date(dateString)
const year = date.getFullYear();
const month = (date.getMonth() + 1).toString().padStart(2, '0'); //
return `${year}-${month}`;
},
formatDate(dateString){
const date = new Date(dateString); //
const year = date.getFullYear(); //
@ -279,10 +308,33 @@
return `${year}-${month}-${day} ${weekday}`; //
},
getDeptList(){
listDept().then(response => {
this.deptOptions = this.handleTree(response.data, "id");
});
},
/** 转换部门数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.orgName,
children: node.children
};
},
handleSelect(value, instanceId) {
console.log('Selected:', value);
//
this.queryParams.orgName=value.orgName;
},
/** 查询月异常列表 */
getList() {
this.loading = true;
this.queryParams.attCurrentMonth = this.searchAttCurrentMonth;
this.queryParams.attCurrentMonth = this.formatDateTwo(this.searchAttCurrentMonth);
listExceptionFormError(this.queryParams).then(response => {
this.tableData = response.rows;
this.total = response.total;
@ -298,10 +350,11 @@
//
reset() {
this.searchAttCurrentMonth = '';
this.queryParams.attCurrentMonth = null;
// this.searchAttCurrentMonth = '';
// this.queryParams.attCurrentMonth = null;
this.queryForm = {};
this.resetForm("queryForm");
this.getList();
},
//
@ -320,7 +373,7 @@
this.queryRecord.userId = row.userId;
this.queryRecord.attCurrentMonth = row.attCurrentMonth;
if(titleBoss=='轮休未审批记录'){
this.get
this.queryRecord.attStatis=1
}else if(titleBoss=='外出办事未审批记录'){
this.queryRecord.attStatis=2;
}
@ -358,12 +411,29 @@
},
/** 审批提醒按钮操作 */
handleExamine() {
handleExamine(row) {
this.resetExamine();
this.queryRecord.orgId = row.orgId;
this.openExamine = true;
this.titleExamine = "补充说明";
},
/** 提交按钮 */
submitForm() {
this.form.orgId = this.queryRecord.orgId;
this.form.title = '轮休外出办事异常数据';
console.log(this.form)
this.$refs["form"].validate(valid => {
if (valid) {
examineRemind(this.form).then(response => {
this.$modal.msgSuccess("审批提醒成功");
this.openExamine = false;
this.getListRecord();
});
}
})
},
//
cancelExamine() {
this.openExamine = false;