休假报备、出差报备:增加 修改、删除按钮,已核定的禁止修改、删除

This commit is contained in:
lSun 2025-02-13 10:57:26 +08:00
parent 65944b86cb
commit c4e5eafcf0
5 changed files with 657 additions and 592 deletions

View File

@ -538,17 +538,25 @@ export default {
// //
startPickerOptions: { startPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
const today = new Date()
today.setHours(0, 0, 0, 0)
if (this.form.leaveEndDate) { if (this.form.leaveEndDate) {
return v.getTime() > new Date(this.form.leaveEndDate).getTime() const end = new Date(this.form.leaveEndDate);
end.setHours(0, 0, 0, 0);
return v.getTime() > end.getTime() || v.getTime() < today.getTime();
} }
return v.getTime() < today.getTime()
}, },
}, },
// //
endPickerOptions: { endPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
const today = new Date()
today.setHours(0, 0, 0, 0)
if (this.form.leaveStartDate) { if (this.form.leaveStartDate) {
return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000; // - 86400000 return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000; // - 86400000
} }
return v.getTime() < today.getTime()
}, },
}, },
daysNumber:"", daysNumber:"",

View File

@ -491,17 +491,25 @@ export default {
// //
startPickerOptions: { startPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
const today = new Date()
today.setHours(0, 0, 0, 0)
if (this.form.leaveEndDate) { if (this.form.leaveEndDate) {
return v.getTime() > new Date(this.form.leaveEndDate).getTime() const end = new Date(this.form.leaveEndDate);
end.setHours(0, 0, 0, 0);
return v.getTime() > end.getTime() || v.getTime() < today.getTime();
} }
return v.getTime() < today.getTime()
}, },
}, },
// //
endPickerOptions: { endPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
const today = new Date()
today.setHours(0, 0, 0, 0)
if (this.form.leaveStartDate) { if (this.form.leaveStartDate) {
return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000; // - 86400000 return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000; // - 86400000
} }
return v.getTime() < today.getTime()
}, },
}, },
daysNumber:"", daysNumber:"",

View File

@ -398,17 +398,27 @@ export default {
// //
startPickerOptions: { startPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
const today = new Date()
today.setHours(0, 0, 0, 0)
if (this.form.leaveEndDate) { if (this.form.leaveEndDate) {
return v.getTime() > new Date(this.form.leaveEndDate).getTime() const end = new Date(this.form.leaveEndDate);
end.setHours(0, 0, 0, 0);
return v.getTime() > end.getTime() || v.getTime() < today.getTime();
} }
return v.getTime() < today.getTime()
}, },
}, },
// //
endPickerOptions: { endPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
const today = new Date()
today.setHours(0, 0, 0, 0)
if (this.form.leaveStartDate) { if (this.form.leaveStartDate) {
return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000; // - 86400000 return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000; // - 86400000
} }
return v.getTime() < today.getTime()
}, },
}, },
daysNumber: "", daysNumber: "",

View File

@ -5,13 +5,15 @@
<el-date-picker <el-date-picker
v-model="queryParams.leaveDate" :clearable="false" v-model="queryParams.leaveDate" :clearable="false"
type="date" value-format="yyyy-MM-dd" style="width: 95%" type="date" value-format="yyyy-MM-dd" style="width: 95%"
placeholder="选择申请时间"> placeholder="选择申请时间"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="审批状态" prop="examineStatus"> <el-form-item label="审批状态" prop="examineStatus">
<el-select <el-select
v-model="queryParams.examineStatus" v-model="queryParams.examineStatus"
placeholder="审批状态" style="width: 95%"> placeholder="审批状态" style="width: 95%"
>
<el-option <el-option
v-for="dict in dict.type.apply_status" v-for="dict in dict.type.apply_status"
:key="dict.value" :key="dict.value"
@ -35,7 +37,8 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['flow:holiday:add']" v-hasPermi="['flow:holiday:add']"
>新增</el-button> >新增
</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -45,7 +48,8 @@
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
>导出</el-button> >导出
</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@ -62,7 +66,9 @@
<el-table-column label="所属部门" align="center" prop="orgName" :show-overflow-tooltip="true" width="240"> <el-table-column label="所属部门" align="center" prop="orgName" :show-overflow-tooltip="true" width="240">
</el-table-column> </el-table-column>
<el-table-column label="申请时间" align="center" prop="createTime" :show-overflow-tooltip="true" width="180"/> <el-table-column label="申请时间" align="center" prop="createTime" :show-overflow-tooltip="true" width="180"/>
<el-table-column label="轮休开始时间" align="center" prop="leaveStartDate" :show-overflow-tooltip="true" width="180"> <el-table-column label="轮休开始时间" align="center" prop="leaveStartDate" :show-overflow-tooltip="true"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.leaveStartDate }} <div>{{ scope.row.leaveStartDate }}
<span v-show="scope.row.leaveStartInterval=='1'">上午</span> <span v-show="scope.row.leaveStartInterval=='1'">上午</span>
@ -70,7 +76,9 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="轮休结束时间" align="center" prop="leaveEndDate" :show-overflow-tooltip="true" width="180"> <el-table-column label="轮休结束时间" align="center" prop="leaveEndDate" :show-overflow-tooltip="true"
width="180"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div>{{ scope.row.leaveEndDate }} <div>{{ scope.row.leaveEndDate }}
<span v-show="scope.row.leaveEndInterval=='1'">上午</span> <span v-show="scope.row.leaveEndInterval=='1'">上午</span>
@ -78,7 +86,9 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="轮休时长(天)" align="center" prop="leaveDuration" :show-overflow-tooltip="true" width="180"/> <el-table-column label="轮休时长(天)" align="center" prop="leaveDuration" :show-overflow-tooltip="true"
width="180"
/>
<el-table-column label="审批状态" align="center" prop="examineStatus" :show-overflow-tooltip="true" width="100"> <el-table-column label="审批状态" align="center" prop="examineStatus" :show-overflow-tooltip="true" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<dict-tag :options="dict.type.apply_status" :value="scope.row.examineStatus"/> <dict-tag :options="dict.type.apply_status" :value="scope.row.examineStatus"/>
@ -92,26 +102,30 @@
v-if="scope.row.examineStatus==3" v-if="scope.row.examineStatus==3"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['flow:holiday:edit']" v-hasPermi="['flow:holiday:edit']"
>编辑</el-button> >编辑
</el-button>
<el-button <el-button
size="mini" size="mini"
v-hasPermi="['flow:holiday:query']" v-hasPermi="['flow:holiday:query']"
@click="handleView(scope.row)" @click="handleView(scope.row)"
>详情</el-button> >详情
</el-button>
<el-button <el-button
size="mini" size="mini"
type="primary" type="primary"
v-hasPermi="['flow:holiday:edit']" v-hasPermi="['flow:holiday:edit']"
v-if="scope.row.examineStatus==0" v-if="scope.row.examineStatus==0"
@click="handleBack(scope.row)" @click="handleBack(scope.row)"
>撤回</el-button> >撤回
</el-button>
<el-button <el-button
size="mini" size="mini"
type="danger" type="danger"
v-hasPermi="['flow:holiday:remove']" v-hasPermi="['flow:holiday:remove']"
v-if="scope.row.examineStatus==2||scope.row.examineStatus==3" v-if="scope.row.examineStatus==2||scope.row.examineStatus==3"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button> >删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -130,20 +144,20 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="申请人:" prop="userName"> <el-form-item label="申请人:" prop="userName">
<el-input v-model="form.userName" :readonly="true" /> <el-input v-model="form.userName" :readonly="true"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="职务:" prop="postName"> <el-form-item label="职务:" prop="postName">
<el-input v-model="form.postName" :readonly="true" /> <el-input v-model="form.postName" :readonly="true"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属部门:" prop="orgId" > <el-form-item label="所属部门:" prop="orgId">
<el-select v-model="form.orgId" @change="changDept" :disabled="isView" style="width: 100%;"> <el-select v-model="form.orgId" @change="changDept" :disabled="isView" style="width: 100%;">
<el-option <el-option
v-for="item in orgList" v-for="item in orgList"
@ -160,22 +174,23 @@
<el-date-picker <el-date-picker
v-model="form.leaveStartDate" :clearable="false" :disabled="isView" v-model="form.leaveStartDate" :clearable="false" :disabled="isView"
type="date" value-format="yyyy-MM-dd" style="width: 100%;" @change="handleDateChange" type="date" value-format="yyyy-MM-dd" style="width: 100%;" @change="handleDateChange"
placeholder="轮休开始时间" :pickerOptions="startPickerOptions"> placeholder="轮休开始时间" :pickerOptions="startPickerOptions"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="4">--> <!-- <el-col :span="4">-->
<!-- <el-form-item prop="leaveStartInterval" label-width="0px">--> <!-- <el-form-item prop="leaveStartInterval" label-width="0px">-->
<!-- <el-select v-model="form.leaveStartInterval" style="width: 80%;margin-left: 10px;" :disabled="isView" @change="handleDateChange">--> <!-- <el-select v-model="form.leaveStartInterval" style="width: 80%;margin-left: 10px;" :disabled="isView" @change="handleDateChange">-->
<!-- <el-option--> <!-- <el-option-->
<!-- v-for="item in timeStatusList"--> <!-- v-for="item in timeStatusList"-->
<!-- :key="item.id"--> <!-- :key="item.id"-->
<!-- :label="item.name"--> <!-- :label="item.name"-->
<!-- :value="item.id"--> <!-- :value="item.id"-->
<!-- />--> <!-- />-->
<!-- </el-select>--> <!-- </el-select>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -183,26 +198,27 @@
<el-date-picker <el-date-picker
v-model="form.leaveEndDate" :clearable="false" :disabled="isView" v-model="form.leaveEndDate" :clearable="false" :disabled="isView"
type="date" value-format="yyyy-MM-dd" style="width: 100%;" @change="handleDateChange" type="date" value-format="yyyy-MM-dd" style="width: 100%;" @change="handleDateChange"
placeholder="轮休结束时间" :pickerOptions="endPickerOptions"> placeholder="轮休结束时间" :pickerOptions="endPickerOptions"
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- <el-col :span="4">--> <!-- <el-col :span="4">-->
<!-- <el-form-item prop="leaveEndInterval" label-width="0px">--> <!-- <el-form-item prop="leaveEndInterval" label-width="0px">-->
<!-- <el-select v-model="form.leaveEndInterval" style="width: 80%;margin-left: 10px;" :disabled="isView" @change="handleDateChange">--> <!-- <el-select v-model="form.leaveEndInterval" style="width: 80%;margin-left: 10px;" :disabled="isView" @change="handleDateChange">-->
<!-- <el-option--> <!-- <el-option-->
<!-- v-for="item in timeStatusList"--> <!-- v-for="item in timeStatusList"-->
<!-- :key="item.id"--> <!-- :key="item.id"-->
<!-- :label="item.name"--> <!-- :label="item.name"-->
<!-- :value="item.id"--> <!-- :value="item.id"-->
<!-- />--> <!-- />-->
<!-- </el-select>--> <!-- </el-select>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="12"> <el-col :span="12">
<el-form-item label="轮休时长(天)" prop="leaveDuration"> <el-form-item label="轮休时长(天)" prop="leaveDuration">
<el-input v-model="form.leaveDuration" :readonly="true" /> <el-input v-model="form.leaveDuration" :readonly="true"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -221,7 +237,8 @@
v-for="item in isAgreeList" v-for="item in isAgreeList"
:key="item.id" :key="item.id"
:label="item.id" :label="item.id"
>{{item.name}}</el-radio> >{{ item.name }}
</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -229,7 +246,9 @@
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="代理主持工作人员:" prop="hostUserId"> <el-form-item label="代理主持工作人员:" prop="hostUserId">
<el-select v-model="form.hostUserId" multiple placeholder="请选择" filterable clearable style="width: 100%;"> <el-select v-model="form.hostUserId" multiple placeholder="请选择" filterable clearable
style="width: 100%;"
>
<el-option <el-option
v-for="item in userList" v-for="item in userList"
:key="item.userId" :key="item.userId"
@ -243,7 +262,8 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注:"> <el-form-item label="备注:">
<el-input type="textarea" placeholder="输入内容" v-model="form.remark" maxlength="100" :readonly="isView"></el-input> <el-input type="textarea" placeholder="输入内容" v-model="form.remark" maxlength="100" :readonly="isView"
></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -261,22 +281,25 @@
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listHoliday,getHoliday,delHoliday,addHoliday,updateHoliday,changeHolidayStatus,exportHoliday,getPostName, import {
getUserList, } from "@/api/process/rest"; listHoliday, getHoliday, delHoliday, addHoliday, updateHoliday, changeHolidayStatus, exportHoliday, getPostName,
import Treeselect from "@riophae/vue-treeselect"; getUserList
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; } from '@/api/process/rest'
import {getDaysDate} from "@/api/process/leaveReporting"; import Treeselect from '@riophae/vue-treeselect'
export default { import '@riophae/vue-treeselect/dist/vue-treeselect.css'
name: "RestApply", import { getDaysDate } from '@/api/process/leaveReporting'
export default {
name: 'RestApply',
dicts: ['apply_status'], dicts: ['apply_status'],
components: { Treeselect }, components: { Treeselect },
data() { data() {
return { return {
userInfo:this.$store.state.user, userInfo: this.$store.state.user,
orgList:this.$store.state.user.orgList, orgList: this.$store.state.user.orgList,
// //
loading: false, loading: false,
// //
@ -292,60 +315,63 @@
// //
tableList: [], tableList: [],
// //
title: "", title: '',
// //
open: false, open: false,
isEdit: false, isEdit: false,
isView: false, isView: false,
userList:[], userList: [],
isAgreeList:[{id:'0',name:'否'},{id:'1',name:'是'}], isAgreeList: [{ id: '0', name: '否' }, { id: '1', name: '是' }],
timeStatusList:[{id:'1',name:"上午"},{id:'2',name:"下午"}], timeStatusList: [{ id: '1', name: '上午' }, { id: '2', name: '下午' }],
// //
dateRange: [], dateRange: [],
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
leaveType:"轮休", leaveType: '轮休',
leaveDate: undefined, leaveDate: undefined,
examineStatus: undefined examineStatus: undefined
}, },
personOptions:[], personOptions: [],
typeList:[{value:'1',label:'固定班制'},{value:'2',label:'自由工时'}], typeList: [{ value: '1', label: '固定班制' }, { value: '2', label: '自由工时' }],
attDayList:[{id:0,label:'周一'},{id:1,label:'周二'},{id:2,label:'周三'},{id:3,label:'周四'},{id:4,label:'周五'},{id:5,label:'周六'},{id:6,label:'周日'}], attDayList: [{ id: 0, label: '周一' }, { id: 1, label: '周二' }, { id: 2, label: '周三' }, {
id: 3,
label: '周四'
}, { id: 4, label: '周五' }, { id: 5, label: '周六' }, { id: 6, label: '周日' }],
// //
form: {}, form: {},
// //
rules: { rules: {
userName:[ userName: [
{required: true, message: "申请人不能为空", trigger: "blur" } { required: true, message: '申请人不能为空', trigger: 'blur' }
], ],
postName:[ postName: [
{required: true, message: "职务不能为空", trigger: "blur" } { required: true, message: '职务不能为空', trigger: 'blur' }
], ],
orgId: [ orgId: [
{ required: true, message: "所属部门不能为空", trigger: "blur" } { required: true, message: '所属部门不能为空', trigger: 'blur' }
], ],
leaveStartDate: [ leaveStartDate: [
{ required: true, message: "轮休开始时间不能为空", trigger: "blur" } { required: true, message: '轮休开始时间不能为空', trigger: 'blur' }
], ],
leaveStartInterval: [ leaveStartInterval: [
{ required: true, message: "不能为空", trigger: "change" } { required: true, message: '不能为空', trigger: 'change' }
], ],
leaveEndDate: [ leaveEndDate: [
{ required: true, message: "轮休结束时间不能为空", trigger: "blur" } { required: true, message: '轮休结束时间不能为空', trigger: 'blur' }
], ],
leaveEndInterval: [ leaveEndInterval: [
{ required: true, message: "不能为空", trigger: "change" } { required: true, message: '不能为空', trigger: 'change' }
], ],
leaveDuration: [ leaveDuration: [
{ required: true, message: "轮休时长不能为空", trigger: "blur" } { required: true, message: '轮休时长不能为空', trigger: 'blur' }
], ],
isAgree:[ isAgree: [
{ required: true, message: "是否请示领导不能为空", trigger: "blur" } { required: true, message: '是否请示领导不能为空', trigger: 'blur' }
], ],
hostUserId:[ hostUserId: [
{ required: true, message: "代理主持工作人员不能为空", trigger: "blur" } { required: true, message: '代理主持工作人员不能为空', trigger: 'blur' }
] ]
// , // ,
// leaveReason: [ // leaveReason: [
@ -355,29 +381,37 @@
// //
startPickerOptions: { startPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
if(this.form.leaveEndDate) { const today = new Date()
return v.getTime() > new Date(this.form.leaveEndDate).getTime() today.setHours(0, 0, 0, 0) // 0
if (this.form.leaveEndDate) {
const end = new Date(this.form.leaveEndDate);
end.setHours(0, 0, 0, 0);
return v.getTime() > end.getTime() || v.getTime() < today.getTime(); //
}
return v.getTime() < today.getTime()
} }
},
}, },
// //
endPickerOptions: { endPickerOptions: {
disabledDate: (v) => { disabledDate: (v) => {
if(this.form.leaveStartDate) { const today = new Date()
return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000; // - 86400000 today.setHours(0, 0, 0, 0) // 0
if (this.form.leaveStartDate) {
return v.getTime() < new Date(this.form.leaveStartDate).getTime() - 86400000 // - 86400000
}
return v.getTime() < today.getTime()
} }
}, },
}, daysNumber: ''
daysNumber:"", }
};
}, },
created() { created() {
this.getList(); this.getList()
this.getUserLists(); this.getUserLists()
}, },
methods: { methods: {
async handleDateChange(){ async handleDateChange() {
if(this.form.leaveStartDate&&this.form.leaveEndDate){ if (this.form.leaveStartDate && this.form.leaveEndDate) {
// //
this.form.leaveStartInterval = 1 this.form.leaveStartInterval = 1
this.form.leaveEndInterval = 2 this.form.leaveEndInterval = 2
@ -387,148 +421,148 @@
this.form.leaveDuration = this.daysNumber this.form.leaveDuration = this.daysNumber
} }
}, },
async daysBetween(date1, date2){ async daysBetween(date1, date2) {
var data = { var data = {
"leaveStartDate":date1, 'leaveStartDate': date1,
"leaveEndDate":date2, 'leaveEndDate': date2
} }
await getDaysDate(data).then(response => { await getDaysDate(data).then(response => {
this.daysNumber = response.data.date; this.daysNumber = response.data.date
}); })
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true
listHoliday(this.queryParams).then(response => { listHoliday(this.queryParams).then(response => {
this.tableList = response.rows; this.tableList = response.rows
this.total = response.total; this.total = response.total
this.loading = false; this.loading = false
} }
); )
}, },
getUserLists(){ getUserLists() {
const Id = this.$store.state.user.id; const Id = this.$store.state.user.id
getUserList(Id).then(response => { getUserList(Id).then(response => {
this.userList = response.data.data; this.userList = response.data.data
console.log("userList",this.userList) console.log('userList', this.userList)
}); })
}, },
// //
cancel() { cancel() {
this.open = false; this.open = false
this.reset(); this.reset()
}, },
// //
reset() { reset() {
this.form = { this.form = {
userId:this.userInfo.id, userId: this.userInfo.id,
userName:this.userInfo.name, userName: this.userInfo.name,
orgId: undefined, orgId: undefined,
leaveStartDate: undefined, leaveStartDate: undefined,
leaveStartInterval:undefined, leaveStartInterval: undefined,
leaveEndDate: undefined, leaveEndDate: undefined,
leaveEndInterval:undefined, leaveEndInterval: undefined,
leaveDuration:undefined, leaveDuration: undefined,
leaveType:"轮休", leaveType: '轮休',
examineStatus:"0", examineStatus: '0',
isAgree: "0", isAgree: '0',
hostUserId:[], hostUserId: [],
leaveReason:undefined, leaveReason: undefined
}; }
this.resetForm("form"); this.resetForm('form')
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1
this.getList(); this.getList()
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = []
this.resetForm("queryForm"); this.resetForm('queryForm')
this.handleQuery(); this.handleQuery()
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
console.log(this.userInfo) console.log(this.userInfo)
console.log(this.orgList) console.log(this.orgList)
this.reset(); this.reset()
const Id = this.$store.state.user.id; const Id = this.$store.state.user.id
getPostName(Id).then(response => { getPostName(Id).then(response => {
this.form.postName = response.data.postName; this.form.postName = response.data.postName
this.open = true; this.open = true
this.isView = false; this.isView = false
this.title = "新增"; this.title = '新增'
}); })
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.Id) this.ids = selection.map(item => item.Id)
this.single = selection.length!=1 this.single = selection.length != 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset()
const Id = row.id const Id = row.id
const userId = this.$store.state.user.id; const userId = this.$store.state.user.id
let postName; let postName
getPostName(userId).then(response => { getPostName(userId).then(response => {
postName = response.data.postName; postName = response.data.postName
return getHoliday(Id); return getHoliday(Id)
}).then(holidayResponse => { }).then(holidayResponse => {
// holiday // holiday
this.form = holidayResponse.data; this.form = holidayResponse.data
console.log(this.form); console.log(this.form)
// hostUserId // hostUserId
if(this.form.hostUserId ==null){ if (this.form.hostUserId == null) {
this.$set(this.form, "hostUserId", 0); this.$set(this.form, 'hostUserId', 0)
}else{ } else {
let numArr = this.form.hostUserId.split(","); let numArr = this.form.hostUserId.split(',')
let num = numArr.map(item => parseInt(item)); // 使 map let num = numArr.map(item => parseInt(item)) // 使 map
this.$set(this.form, "hostUserId", num); this.$set(this.form, 'hostUserId', num)
} }
this.$set(this.form,"postName",postName) this.$set(this.form, 'postName', postName)
// //
this.open = true; this.open = true
this.isView = false; this.isView = false
this.title = "编辑"; this.title = '编辑'
}); })
}, },
handleView(row) { handleView(row) {
this.reset(); this.reset()
const Id = row.id const Id = row.id
const userId = this.$store.state.user.id; const userId = this.$store.state.user.id
let postName; let postName
getPostName(userId).then(response => { getPostName(userId).then(response => {
postName = response.data.postName; postName = response.data.postName
return getHoliday(Id); return getHoliday(Id)
}).then(holidayResponse => { }).then(holidayResponse => {
// holiday // holiday
this.form = holidayResponse.data; this.form = holidayResponse.data
console.log(this.form); console.log(this.form)
// hostUserId // hostUserId
if(this.form.hostUserId ==null){ if (this.form.hostUserId == null) {
this.$set(this.form, "hostUserId", 0); this.$set(this.form, 'hostUserId', 0)
}else{ } else {
let numArr = this.form.hostUserId.split(","); let numArr = this.form.hostUserId.split(',')
let num = numArr.map(item => parseInt(item)); // 使 map let num = numArr.map(item => parseInt(item)) // 使 map
this.$set(this.form, "hostUserId", num); this.$set(this.form, 'hostUserId', num)
} }
this.$set(this.form,"postName",postName) this.$set(this.form, 'postName', postName)
// //
this.open = true; this.open = true
this.isView = true; this.isView = true
this.title = "查看"; this.title = '查看'
}); })
}, },
// //
changDept(e){ changDept(e) {
console.log(e) console.log(e)
this.orgList.forEach(item=>{ this.orgList.forEach(item => {
if(item.id==e){ if (item.id == e) {
this.form.orgName = item.name this.form.orgName = item.name
} }
}) })
@ -536,70 +570,75 @@
/** 提交按钮 */ /** 提交按钮 */
submitForm: function() { submitForm: function() {
console.log(this.form) console.log(this.form)
this.$refs["form"].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
console.log(this.form) console.log(this.form)
var list = this.form.hostUserId.join(","); var list = this.form.hostUserId.join(',')
// //
const userIdArray = list.split(','); const userIdArray = list.split(',')
// 00 // 00
const containsZero = userIdArray.includes('0'); const containsZero = userIdArray.includes('0')
const containsOtherValues = userIdArray.some(id => id !== '0'); const containsOtherValues = userIdArray.some(id => id !== '0')
if (containsZero && containsOtherValues) { if (containsZero && containsOtherValues) {
this.$modal.msgError("选择’/‘后不能在选择其他人员"); this.$modal.msgError('选择’/‘后不能在选择其他人员')
return ; return
} }
this.form.hostUserId = list; this.form.hostUserId = list
if (this.form.id != undefined) { if (this.form.id != undefined) {
this.form.examineStatus=0 this.form.examineStatus = 0
updateHoliday(this.form).then(response => { updateHoliday(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess('修改成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} else { } else {
addHoliday(this.form).then(response => { addHoliday(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess('新增成功')
this.open = false; this.open = false
this.getList(); this.getList()
}); })
} }
} }
}); })
}, },
handleBack(row) { handleBack(row) {
var that = this; var that = this
this.$modal.confirm('是否确认撤回该申请?').then(function() { this.$modal.confirm('是否确认撤回该申请?').then(function() {
let param = { let param = {
id:row.id, id: row.id,
examineStatus:'3', examineStatus: '3'
} }
changeHolidayStatus(param).then(response => { changeHolidayStatus(param).then(response => {
that.getList(); that.getList()
this.$modal.msgSuccess("撤回成功"); this.$modal.msgSuccess('撤回成功')
}); })
}) })
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const Ids = row.id; const Ids = row.id
this.$modal.confirm('是否确认删除该申请?').then(function() { this.$modal.confirm('是否确认删除该申请?').then(function() {
return delHoliday(Ids); return delHoliday(Ids)
}).then(() => { }).then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess('删除成功')
}).catch(() => {}); }).catch(() => {
})
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.queryParams.exportType="查询"; this.queryParams.exportType = '查询'
exportHoliday(this.queryParams).then(res => { exportHoliday(this.queryParams).then(res => {
this.downloadFile({ fileName: `轮休_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' }) this.downloadFile({
fileName: `轮休_${new Date().getTime()}.xlsx`,
fileData: res,
fileType: 'application/vnd.ms-excel;charset=utf-8'
}) })
}, })
}
} }
}; }
</script> </script>

View File

@ -56,7 +56,7 @@
</el-table-column> </el-table-column>
<el-table-column label="出差人数" align="center" width="180"> <el-table-column label="出差人数" align="center" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="clickable" @click="handleClick('出差报备',scope.row)" style="color: blue; cursor: pointer;"> <span class="clickable" @click="handleClick('出差',scope.row)" style="color: blue; cursor: pointer;">
{{ scope.row.businessTripNum }} {{ scope.row.businessTripNum }}
</span> </span>
</template> </template>
@ -588,7 +588,7 @@ export default {
this.title = "轮休人员"; this.title = "轮休人员";
} else if (type==='临时外出'){ } else if (type==='临时外出'){
this.title = "临时外出人员"; this.title = "临时外出人员";
} else if (type==='出差报备'){ } else if (type==='出差'){
this.title = "出差人员"; this.title = "出差人员";
} else if (type==='请假'){ } else if (type==='请假'){
this.title = "请假人数"; this.title = "请假人数";
@ -619,7 +619,7 @@ export default {
}); });
}, },
handleRowClick(row) { handleRowClick(row) {
if (this.searchConditions.type==='出差报备'){ if (this.searchConditions.type==='出差'){
getEvection(row.uuId).then(response => { getEvection(row.uuId).then(response => {
this.form = response.data; this.form = response.data;
let num = []; let num = [];