轮休外出办事异常

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 <el-date-picker
v-model="queryParams.attCurrentMonth" v-model="queryParams.attCurrentMonth"
style="width: 240px" style="width: 240px"
placeholder="请选择选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM" value-format="yyyy-MM"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="部门" prop="orgName"> <el-form-item label="部门" prop="orgId">
<el-select v-model="queryParams.orgName" placeholder="选择部门" clearable style="width: 100%;"> <treeselect v-model="queryParams.orgId" :options="deptOptions" :normalizer="normalizer" @select="handleSelect" placeholder="选择部门" style="width: 240px"/>
<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> </el-form-item>
<el-form-item label="姓名:" prop="name"> <el-form-item label="姓名:" prop="name">
<el-input <el-input
@ -50,7 +43,6 @@
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span> <span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template> </template>
</el-table-column> </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="name" sortable/>
<el-table-column label="所属部门" align="center" prop="orgName" sortable/> <el-table-column label="所属部门" align="center" prop="orgName" sortable/>
<el-table-column label="应出勤天数" align="center" prop="requiredDays" sortable/> <el-table-column label="应出勤天数" align="center" prop="requiredDays" sortable/>
@ -210,23 +202,24 @@
<script> <script>
import { listMonthlyError,getDetail,exportMonthlyError} from "@/api/attendanceReport/monthlyError"; 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 { downloadFile } from '@/utils/download'
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
// import { getEngineeringList } from "@/api/select"; // import { getEngineeringList } from "@/api/select";
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
export default { export default {
name: "Post", name: "Post",
dicts: ['sys_normal_disable','sys_voltage_level','sys_org_name','sys_pro_type','sys_pro_status', // 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'], // 'sys_yz_manage','sys_sg_manage','sys_jl_manage','sys_device_type'],
components: { components: { Treeselect },
},
data() { data() {
return { return {
showAttribute:false, showAttribute:false,
// //
loading: true, loading: false,
// //
loadingTwo: true, loadingTwo: false,
// //
ids: [], ids: [],
// //
@ -260,6 +253,7 @@
attCurrentMonth:undefined, attCurrentMonth:undefined,
name:undefined, name:undefined,
orgName: undefined, orgName: undefined,
orgId: undefined,
}, },
queryRecord: { queryRecord: {
@ -294,13 +288,27 @@
return `${year}-${month}-${day} ${weekday}`; // return `${year}-${month}-${day} ${weekday}`; //
}, },
/** 查询部门列表 */ getDeptList(){
getDeptList() { listDept().then(response => {
this.loading = true; this.deptOptions = this.handleTree(response.data, "id");
listDept().then(response => { });
this.deptList = this.handleTree(response.data, "id"); },
this.loading = false; /** 转换部门数据结构 */
}); 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(); this.getListRecord();
}, },
// //
openRecord(row,titleBoss){ openRecord(row,titleBoss){
this.id = row.id; 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 :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="选择月份:" prop="attCurrentMonth"> <el-form-item label="选择月份:" prop="attCurrentMonth">
<el-date-picker <el-date-picker
v-model="queryParams.attCurrentMonth" v-model="searchAttCurrentMonth"
style="width: 240px" style="width: 240px"
placeholder="请选择月份" placeholder="请选择月份"
type="month" type="month"
value-format="yyyy-MM" value-format="yyyy-MM"
@change="handleChange"
:clearable="false"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
@ -153,6 +155,7 @@
showSearch: true, showSearch: true,
showRecord:false, showRecord:false,
maxLength:100,// maxLength:100,//
searchAttCurrentMonth: undefined,
// //
total: 0, total: 0,
totalTwo: 0, totalTwo: 0,
@ -195,11 +198,30 @@
computed: { computed: {
}, },
created() { created() {
const lastMonth = new Date();
lastMonth.setMonth(lastMonth.getMonth() - 1)
this.searchAttCurrentMonth = lastMonth;
this.getList(); this.getList();
}, },
mounted(){ mounted(){
}, },
methods: { 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){ formatDate(dateString){
const date = new Date(dateString); // const date = new Date(dateString); //
const year = date.getFullYear(); // const year = date.getFullYear(); //
@ -214,6 +236,8 @@
/** 查询月异常列表 */ /** 查询月异常列表 */
getList() { getList() {
this.loading = true; this.loading = true;
this.queryParams.attCurrentMonth = this.formatDateTwo(this.searchAttCurrentMonth);
console.log(this.queryParams.attCurrentMonth)
listExceptionDataError(this.queryParams).then(response => { listExceptionDataError(this.queryParams).then(response => {
this.tableData = response.rows; this.tableData = response.rows;
this.total = response.total; this.total = response.total;

View File

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