Browse Source

请假申请

sangwenwei 1 year ago
parent
commit
90d80efdca

+ 61 - 0
src/api/jy/HolidayService.js

@@ -0,0 +1,61 @@
+import request from '@/utils/httpRequest'
+import { BUSINESS_PATH as prefix } from "../AppPath";
+
+export default class HolidayService{
+	list (param) {
+		return request({
+			url: prefix +'/holiday/findList',
+			method: 'get',
+			params: param
+		})
+	}
+
+	saveForm (inputForm) {
+		return request({
+			url: prefix + `/holiday/saveForm`,
+			method: 'post',
+			data: inputForm
+		})
+	}
+
+	queryById (id) {
+		return request({
+			url: prefix +'/holiday/findById',
+			method: 'get',
+			params: {id: id}
+		})
+	}
+
+	updateStatusById(data) {
+		return request({
+			url: prefix + "/holiday/updateStatusById",
+			method: "post",
+			data: data,
+		})
+	}
+	delete (ids) {
+		return request({
+			url: prefix+"/holiday/delete",
+			method: 'delete',
+			params: {id: ids}
+		})
+	}
+
+
+	adminEditForm(param){
+		return request({
+			url: prefix + "/holiday/adminEditForm",
+			method: "post",
+			data: param,
+		})
+	}
+
+	checkType (inputForm) {
+		return request({
+			url: prefix + `/holiday/checkType`,
+			method: 'post',
+			data: inputForm
+		})
+	}
+
+}

+ 20 - 6
src/views/flowable/task/TaskForm.vue

@@ -505,7 +505,10 @@ export default {
 						if (recordType) {
 						if (recordType) {
 							this.recordType = recordType
 							this.recordType = recordType
 						}
 						}
-						console.log('this.recordType', this.recordType)
+						if (inputForm.days){
+							this.days=inputForm.days
+						}
+						console.log('this.days', this.days)
 						let assignee = this.auditForm.assignee
 						let assignee = this.auditForm.assignee
 						if (!this.commonJS.isEmpty(inputForm.assignee)) {
 						if (!this.commonJS.isEmpty(inputForm.assignee)) {
 							assignee = inputForm.assignee
 							assignee = inputForm.assignee
@@ -519,7 +522,8 @@ export default {
 								...vars,
 								...vars,
 								title: this.title,
 								title: this.title,
 								assignee: assignee,
 								assignee: assignee,
-								recordType: this.recordType
+								recordType: this.recordType,
+								days: this.days,
 							})
 							})
 							.then((data) => {
 							.then((data) => {
 								this.$message.success("启动成功");
 								this.$message.success("启动成功");
@@ -596,7 +600,9 @@ export default {
 					}
 					}
 					console.log('recordType', recordType)
 					console.log('recordType', recordType)
 					this.recordType=recordType
 					this.recordType=recordType
-					console.log('this.recordType', this.recordType)
+					if (!this.commonJS.isEmpty(inputForm.days)) {
+						this.days=inputForm.days
+					}
 					taskService.audit({
 					taskService.audit({
 						taskId: this.taskId,
 						taskId: this.taskId,
 						taskDefKey: this.taskDefKey,
 						taskDefKey: this.taskDefKey,
@@ -605,7 +611,8 @@ export default {
 						vars: vars,
 						vars: vars,
 						comment: this.auditForm,
 						comment: this.auditForm,
 						assignee: assignee,
 						assignee: assignee,
-						recordType: this.recordType
+						recordType: this.recordType,
+						days: this.days
 					}).then((data) => {
 					}).then((data) => {
 						this.$message.success('提交成功')
 						this.$message.success('提交成功')
 						this.changeBusiness()
 						this.changeBusiness()
@@ -718,6 +725,7 @@ export default {
 		// Process_1702277270803 嘉溢-报销管理
 		// Process_1702277270803 嘉溢-报销管理
 		// Process_1702434644158 嘉溢-发票审核
 		// Process_1702434644158 嘉溢-发票审核
 		// Process_1702435147188 嘉溢-发票作废
 		// Process_1702435147188 嘉溢-发票作废
+		// Process_1702534302878 嘉溢-请假申请
 
 
 		// 驳回
 		// 驳回
 		reject(vars) {
 		reject(vars) {
@@ -780,7 +788,8 @@ export default {
 				this.procDefId.includes('Process_1702002020267') ||
 				this.procDefId.includes('Process_1702002020267') ||
 				this.procDefId.includes('Process_1702277270803') ||
 				this.procDefId.includes('Process_1702277270803') ||
 				this.procDefId.includes('Process_1702434644158') ||
 				this.procDefId.includes('Process_1702434644158') ||
-				this.procDefId.includes('Process_1702435147188')
+				this.procDefId.includes('Process_1702435147188') ||
+				this.procDefId.includes('Process_1702534302878')
 			) {
 			) {
 				console.log('进入新版驳回')
 				console.log('进入新版驳回')
 				this.$confirm(`确定驳回流程吗?`, '提示', {
 				this.$confirm(`确定驳回流程吗?`, '提示', {
@@ -1058,6 +1067,9 @@ export default {
 							if (this.commonJS.isNotEmpty(inputForm.assignee)) {
 							if (this.commonJS.isNotEmpty(inputForm.assignee)) {
 								this.auditForm.assignee = inputForm.assignee
 								this.auditForm.assignee = inputForm.assignee
 							}
 							}
+							if (this.commonJS.isNotEmpty(inputForm.days)) {
+								this.days = inputForm.days
+							}
 						}
 						}
 						vars = { ...vars, ...inputForm,recordType }
 						vars = { ...vars, ...inputForm,recordType }
 						taskService
 						taskService
@@ -1069,7 +1081,8 @@ export default {
 								vars: vars,
 								vars: vars,
 								comment: this.auditForm,
 								comment: this.auditForm,
 								assignee: this.auditForm.assignee,
 								assignee: this.auditForm.assignee,
-								recordType:recordType
+								recordType:recordType,
+								days :this.days
 							})
 							})
 							.then((data) => {
 							.then((data) => {
 								this.$message.success("提交成功");
 								this.$message.success("提交成功");
@@ -1349,6 +1362,7 @@ export default {
 			dataListHi: [],
 			dataListHi: [],
 			dataListHiCollect: [],
 			dataListHiCollect: [],
 			recordType:'',
 			recordType:'',
+			days:'',
 			companyName:''
 			companyName:''
 		};
 		};
 	},
 	},

+ 471 - 0
src/views/jy/holiday/HolidayDia.vue

@@ -0,0 +1,471 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-dialog
+			:title="title"
+			:close-on-click-modal="false"
+			draggable
+			width="1300px"
+			@close="close"
+			@keyup.enter.native=""
+			v-model="visible">
+		<el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'"
+				 label-width="160px" @submit.native.prevent>
+			<el-divider content-position="left"><i class="el-icon-document"></i>
+				基本信息
+			</el-divider>
+			<el-row  :gutter="15">
+				<el-col :span="12">
+					<el-form-item label="开始时间" prop="startDay"
+								  :rules="[
+								  {required: true, message:'开始时间不能为空', trigger:'blur'}]">
+						<el-date-picker
+							style="width: 50%"
+							v-model="inputForm.startDay"
+							type="date"
+							format="YYYY-MM-DD"
+							value-format="YYYY-MM-DD"
+							placeholder="选择日期"
+							@change="checkTime"
+						/>
+						<el-select v-model="inputForm.beginTime" placeholder="请选择开始时间" @change="checkTime">
+							<el-option value="上午" label="上午"></el-option>
+							<el-option value="下午" label="下午"></el-option>
+						</el-select>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="结束时间" prop="endDay"
+								  :rules="[
+								  {required: true, message:'结束时间不能为空', trigger:'blur'}]">
+						<el-date-picker
+							style="width:50%;"
+							v-model="inputForm.endDay"
+							type="date"
+							format="YYYY-MM-DD"
+							value-format="YYYY-MM-DD"
+							placeholder="请选择日期"
+							:size="default"
+							@change="checkTime"
+						/>
+						<el-select v-model="inputForm.endTime" placeholder="请选择开始时间" @change="checkTime">
+							<el-option value="上午" label="上午"></el-option>
+							<el-option value="下午" label="下午"></el-option>
+						</el-select>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item prop="type" label="请假类型"
+								  :rules="[ {required: true, message:'请假类型不能为空', trigger:'blur'}]">
+						<el-select v-model="inputForm.type" @change="checkType" placeholder="请选择" style="width:100%;">
+							<el-option
+								v-for="item in $dictUtils.getDictList('jy_holiday_type')"
+								:key="item.value"
+								:label="item.label"
+								:value="item.value">
+							</el-option>
+						</el-select>
+					</el-form-item>
+				</el-col>
+				<el-col :span="24">
+					<el-form-item label="请假原因" prop="reason"
+								  :rules="[]">
+						<el-input :disabled="status === 'audit' || status === 'taskFormDetail' || method === 'view'" type="textarea" placeholder="请输入请假原因"  maxlength="500"  style="width:100%" v-model="inputForm.reason" show-word-limit></el-input>
+					</el-form-item>
+				</el-col>
+			</el-row>
+		</el-form>
+		<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+			<template #footer>
+			<span class="dialog-footer">
+			  <el-button  @click="close()" icon="el-icon-circle-close">关闭</el-button>
+			  <el-button  type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+			</span>
+			</template>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import XEUtils from 'xe-utils'
+	import HolidayService from '@/api/jy/HolidayService'
+	import { ElDatePicker } from 'element-plus';
+	import UserSelectSignatory from '../workClientInfo/clientUserSelect'
+	import UpLoadComponent from '@/views/common/UpLoadComponent'
+	import CommonApi from '@/api/cw/common/CommonApi'
+	import SelectTree from '@/components/treeSelect/treeSelect.vue'
+	export default {
+		props: {
+			businessId: {
+				type: String,
+				default: ''
+			},
+			formReadOnly: {
+				type: Boolean,
+				default: false
+			},
+			status: {
+				type: String,
+				default: ''
+			}
+		},
+		data () {
+			return {
+				title: '',
+				method: '',
+				loading: false,
+				visible: false,
+				inputForm: {
+					id: '',
+					startDay:"",
+					beginTime:'',
+					reason: '',
+					endDay:"",
+					endTime:'',
+					type:'',
+					files: [], // 附件信息
+					procInsId: '',
+					days:'',
+				},
+				baseKey: '',
+				keyWatch: '',
+				dateList:[],
+				programRow:'',
+				days:'',
+
+			}
+		},
+		HolidayService:null,
+		commonApi: null,
+		created () {
+			this.holidayService=new HolidayService()
+			this.commonApi = new CommonApi()
+		},
+		mounted () {
+		},
+		activated () {
+		},
+		components: {
+			ElDatePicker,
+			UserSelectSignatory,
+			UpLoadComponent,
+			SelectTree,
+		},
+		computed: {
+			bus: {
+				get () {
+					this.$refs.uploadComponent.setDividerName('附件')
+					return this.businessId
+				},
+				set (val) {
+					this.businessId = val
+				}
+			}
+		},
+		watch: {
+			'keyWatch': {
+				handler (newVal) {
+					console.log('几里路')
+					if (this.bus) {
+						if (this.bus !== 'false') {
+							this.init('', this.bus)
+						}
+					} else {
+						this.$nextTick(() => {
+							this.$refs.inputForm.resetFields()
+						})
+					}
+				}
+			},
+			'loading': {
+				handler (newVal) {
+					this.$emit('changeLoading', newVal)
+					this.$refs.uploadComponent.changeLoading(newVal)
+				}
+			}
+		},
+		methods: {
+			getKeyWatch(keyWatch) {
+				this.keyWatch = keyWatch
+			},
+			init(method, id) {
+				this.method = method
+				this.inputForm={
+					id: '',
+					startDay:"",
+					beginTime:'',
+					reason: '',
+					endDay:"",
+					endTime:'',
+					type:'',
+					files: [], // 附件信息
+					procInsId: '',
+					days:'',
+				}
+				this.inputForm.id = id
+				this.loading = false
+				this.visible = true
+				if (method === 'edit'){
+					this.title = '修改请假信息'
+				}
+				this.$nextTick(() => {
+					this.$refs.inputForm.resetFields()
+					this.loading = true
+					this.$refs.uploadComponent.clearUpload()
+					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+						console.log('this.inputForm.id', this.inputForm.id)
+						this.holidayService.queryById(this.inputForm.id).then((data)=>{
+							this.inputForm = this.recover(this.inputForm, data)
+							this.days=data.days
+							this.inputForm.files=data.files
+							console.log('s',this.inputForm)
+							if (this.status === 'audit' || this.status === 'taskFormDetail') {
+								method = 'view'
+							}
+							console.log('me',method)
+							this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'jyHoliday',null,null,null,null,null)
+							this.loading = false
+						})
+
+					}
+				})
+			},
+			saveForm(callback) {
+				this.doSubmit('save', callback)
+			},
+			startForm(callback) {
+				this.loading = true
+				if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					this.holidayService.queryById(this.inputForm.id).then((data) => {
+						if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+							this.loading = false
+							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+							throw new Error()
+						} else {
+							this.doSubmit('start', callback)
+						}
+					})
+				} else {
+					this.doSubmit('start', callback)
+				}
+			},
+			async agreeForm(callback) {
+				console.log('进入方法')
+				this.loading = true
+				await this.holidayService.queryById(this.inputForm.id).then((data) => {
+					if (data.status !== '2' ) { // status的值不等于“审核中”,就弹出提示
+						this.loading = false
+						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						throw new Error()
+					} else {
+						this.inputForm.status= '2'
+						if (this.inputForm.days>1){
+							this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((da)=>{
+								if (this.commonJS.isNotEmpty(da)) {
+									if (da === '总经理审核') {
+										this.inputForm.status = '5'
+									}
+								}
+								let param = {status: this.inputForm.status, id: this.inputForm.id}
+								this.inputForm=JSON.stringify(this.inputForm)
+								this.holidayService.updateStatusById(param).then(() => {
+									callback(data.businessTable, data.businessId, this.inputForm,data.days)
+									this.loading = false
+								}).catch(() => {
+									this.loading = false
+								})
+							})
+						}else {
+							this.inputForm.status= '5'
+							let param = {status: this.inputForm.status, id: this.inputForm.id}
+							this.inputForm=JSON.stringify(this.inputForm)
+							this.holidayService.updateStatusById(param).then(() => {
+								callback(data.businessTable, data.businessId, this.inputForm,data.days)
+								this.loading = false
+							}).catch(() => {
+								this.loading = false
+							})
+						}
+
+					}
+				})
+			},
+			reapplyForm(callback) {
+				this.loading = true
+				this.holidayService.queryById(this.inputForm.id).then((data) => {
+					if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+						this.loading = false
+						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+					} else {
+						this.doSubmit('reapply', callback)
+					}
+				})
+			},
+			// 表单提交
+			async doSubmit(status, callback) {
+				this.loading = true
+				console.log('5',this.inputForm)
+				if (status === 'save') {
+					// 暂存
+					this.loading = true
+					this.inputForm.status = '1'
+					if (this.$refs.uploadComponent.checkProgress()) {
+						this.loading = false
+						return
+					}
+					this.inputForm.files = this.$refs.uploadComponent.getDataList()
+					this.holidayService.saveForm(this.inputForm).then((data) => {
+						callback(data.businessTable, data.businessId, this.inputForm,data.days)
+						this.loading = false
+					}).catch(() => {
+						this.loading = false
+					})
+					return
+				} else if (status === 'start') {
+
+					if (this.commonJS.isEmpty(this.inputForm.startDay) || this.commonJS.isEmpty(this.inputForm.beginTime)){
+						this.$message.error('请选择开始时间')
+						this.loading = false
+					}
+					if (this.commonJS.isEmpty(this.inputForm.endDay) || this.commonJS.isEmpty(this.inputForm.endTime)){
+						this.$message.error('请选择结束时间')
+						this.loading = false
+					}
+					if (this.commonJS.isEmpty(this.inputForm.type)){
+						this.$message.error('请选择请假类型')
+						this.loading = false
+					}
+					if (this.$refs.uploadComponent.checkProgress()) {
+						this.loading = false
+						return
+					}
+					this.inputForm.files = this.$refs.uploadComponent.getDataList()
+					// 送审  待审核
+					this.inputForm.status = '2'
+				} else if (status === 'agree') {
+					this.inputForm.status= '5'
+				} else if (status === 'reapply') {
+					this.inputForm.status = '2'
+				}
+				this.$refs['inputForm'].validate((valid) => {
+					if (valid) {
+						this.loading = true
+						console.log('form',this.inputForm)
+						this.inputForm=JSON.parse(JSON.stringify(this.inputForm))
+						this.holidayService.saveForm(this.inputForm).then((data) => {
+							this.visible = false
+							this.$emit('refreshList')
+						}).catch(() => {
+							this.$refs.inputForm.resetFields()
+							this.loading = false
+						})
+					} else {
+						this.loading = false
+					}
+				})
+			},
+			close() {
+				this.inputForm = {
+					id: '',
+					startDay:"",
+					beginTime:'',
+					reason: '',
+					endDay:"",
+					endTime:'',
+					type:'',
+					files: [], // 附件信息
+					procInsId: '',
+					days:'',
+				}
+				this.visible = false
+			},
+			async updateStatusById(type, callback) {
+				this.loading = true
+				if (type === 'reject' || type === 'reback') {
+					this.holidayService.queryById(this.inputForm.id).then((data) => {
+						if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+							this.loading = false
+							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+							throw new Error()
+						} else {
+							// if (type === 'agree') {
+							//   // 同意
+							//   this.inputForm.status = '5'
+							// }
+							if (type === 'reject') {
+								// 驳回
+								this.inputForm.status = '4'
+							}
+							if (type === 'reback') {
+								// 撤回
+								this.inputForm.status = '3'
+							}
+							if (type === 'reject' || type === 'reback') {
+								let param = {status: this.inputForm.status, id: this.inputForm.id}
+								this.holidayService.updateStatusById(param).then(() => {
+									this.loading = false
+									callback()
+								})
+							}
+						}
+					})
+				} else if (type === 'hold') {
+					this.holidayService.queryById(this.inputForm.id).then((data) => {
+						if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+							this.loading = false
+							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+							throw new Error()
+						} else {
+							// 终止
+							let param = {status: '1', id: this.inputForm.id}
+							this.holidayService.updateStatusById(param).then(() => {
+								this.loading = false
+								callback()
+							})
+						}
+					})
+				}
+
+			},
+			checkType(){
+				if (this.inputForm.type === '1'){
+					this.holidayService.checkType(this.inputForm).then((data)=>{
+						console.log('data',data)
+						this.$message.error(data)
+						throw new Error()
+
+					})
+				}
+			},
+			checkTime(){
+				let differenceInDays =''
+				let date1=new Date(this.inputForm.startDay)
+				let date2=new Date(this.inputForm.endDay)
+				if ((date2<date1) || (date2 === date1 && this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午')){
+					this.$message.error('开始时间不能小于结束时间')
+					throw new Error()
+				}
+				differenceInDays= Math.floor((date2 - date1) / (1000 * 60 * 60 * 24));
+				if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '下午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午') ){
+					differenceInDays=differenceInDays+1
+				}else if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '上午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '下午')){
+					differenceInDays=differenceInDays+0.5
+				}
+
+
+				console.log('differenceInDays',differenceInDays)
+				this.inputForm.days = differenceInDays
+			}
+
+		}
+
+	}
+</script>
+<style scoped>
+	/deep/ .el-input-number .el-input__inner {
+		text-align: left;
+	}
+	/deep/ .vxe-footer--row .vxe-footer--column:nth-child(1) .vxe-cell--item {
+		font-weight:700;
+	}
+</style>

+ 456 - 0
src/views/jy/holiday/HolidayForm.vue

@@ -0,0 +1,456 @@
+<template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
+	<div>
+		<el-form :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="status === 'audit' || status === 'taskFormDetail'"
+				 label-width="160px" @submit.native.prevent>
+			<el-divider content-position="left"><i class="el-icon-document"></i>
+				基本信息
+			</el-divider>
+			<el-row  :gutter="15">
+				<el-col :span="12">
+					<el-form-item label="开始时间" prop="startDay"
+								  :rules="[
+								  {required: true, message:'开始时间不能为空', trigger:'blur'}]">
+						<el-date-picker
+							style="width: 50%"
+							v-model="inputForm.startDay"
+							type="date"
+							format="YYYY-MM-DD"
+							value-format="YYYY-MM-DD"
+							placeholder="选择日期"
+							@change="checkTime"
+						/>
+						<el-select v-model="inputForm.beginTime" placeholder="请选择开始时间" @change="checkTime">
+							<el-option value="上午" label="上午"></el-option>
+							<el-option value="下午" label="下午"></el-option>
+						</el-select>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item label="结束时间" prop="endDay"
+								  :rules="[
+								  {required: true, message:'结束时间不能为空', trigger:'blur'}]">
+						<el-date-picker
+							style="width:50%;"
+							v-model="inputForm.endDay"
+							type="date"
+							format="YYYY-MM-DD"
+							value-format="YYYY-MM-DD"
+							placeholder="请选择日期"
+							:size="default"
+							@change="checkTime"
+						/>
+						<el-select v-model="inputForm.endTime" placeholder="请选择开始时间" @change="checkTime">
+							<el-option value="上午" label="上午"></el-option>
+							<el-option value="下午" label="下午"></el-option>
+						</el-select>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item prop="type" label="请假类型"
+								  :rules="[ {required: true, message:'请假类型不能为空', trigger:'blur'}]">
+						<el-select v-model="inputForm.type" @change="checkType" placeholder="请选择" style="width:100%;">
+							<el-option
+								v-for="item in $dictUtils.getDictList('jy_holiday_type')"
+								:key="item.value"
+								:label="item.label"
+								:value="item.value">
+							</el-option>
+						</el-select>
+					</el-form-item>
+				</el-col>
+				<el-col :span="24">
+					<el-form-item label="请假原因" prop="reason"
+								  :rules="[]">
+						<el-input :disabled="status === 'audit' || status === 'taskFormDetail' || method === 'view'" type="textarea" placeholder="请输入请假原因"  maxlength="500"  style="width:100%" v-model="inputForm.reason" show-word-limit></el-input>
+					</el-form-item>
+				</el-col>
+			</el-row>
+		</el-form>
+		<UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+
+	</div>
+</template>
+
+<script>
+	import XEUtils from 'xe-utils'
+	import HolidayService from '@/api/jy/HolidayService'
+	import { ElDatePicker } from 'element-plus';
+	import UserSelectSignatory from '../workClientInfo/clientUserSelect'
+	import UpLoadComponent from '@/views/common/UpLoadComponent'
+	import CommonApi from '@/api/cw/common/CommonApi'
+	import SelectTree from '@/components/treeSelect/treeSelect.vue'
+	export default {
+		props: {
+			businessId: {
+				type: String,
+				default: ''
+			},
+			formReadOnly: {
+				type: Boolean,
+				default: false
+			},
+			status: {
+				type: String,
+				default: ''
+			}
+		},
+		data () {
+			return {
+				title: '',
+				method: '',
+				loading: false,
+				inputForm: {
+					id: '',
+					startDay:"",
+					beginTime:'',
+					reason: '',
+					endDay:"",
+					endTime:'',
+					type:'',
+					files: [], // 附件信息
+					procInsId: '',
+					days:'',
+				},
+				baseKey: '',
+				keyWatch: '',
+				dateList:[],
+				programRow:'',
+				days:'',
+
+			}
+		},
+		HolidayService:null,
+		commonApi: null,
+		created () {
+			this.holidayService=new HolidayService()
+			this.commonApi = new CommonApi()
+		},
+		mounted () {
+		},
+		activated () {
+		},
+		components: {
+			ElDatePicker,
+			UserSelectSignatory,
+			UpLoadComponent,
+			SelectTree,
+		},
+		computed: {
+			bus: {
+				get () {
+					this.$refs.uploadComponent.setDividerName('附件')
+					return this.businessId
+				},
+				set (val) {
+					this.businessId = val
+				}
+			}
+		},
+		watch: {
+			'keyWatch': {
+				handler (newVal) {
+					console.log('几里路')
+					if (this.bus) {
+						if (this.bus !== 'false') {
+							this.init('', this.bus)
+						}
+					} else {
+						this.$nextTick(() => {
+							this.$refs.inputForm.resetFields()
+						})
+					}
+				}
+			},
+			'loading': {
+				handler (newVal) {
+					this.$emit('changeLoading', newVal)
+					this.$refs.uploadComponent.changeLoading(newVal)
+				}
+			}
+		},
+		methods: {
+			getKeyWatch(keyWatch) {
+				this.keyWatch = keyWatch
+			},
+			init(method, id) {
+				this.method = method
+				this.inputForm={
+					id: '',
+					startDay:"",
+					beginTime:'',
+					reason: '',
+					endDay:"",
+					endTime:'',
+					type:'',
+					files: [], // 附件信息
+					procInsId: '',
+					days:'',
+				}
+				this.inputForm.id = id
+				this.loading = false
+				this.$nextTick(() => {
+					this.$refs.inputForm.resetFields()
+					this.loading = true
+					this.$refs.uploadComponent.clearUpload()
+					if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+						console.log('this.inputForm.id', this.inputForm.id)
+						this.holidayService.queryById(this.inputForm.id).then((data)=>{
+							this.inputForm = this.recover(this.inputForm, data)
+							this.days=data.days
+							this.inputForm.files=data.files
+							console.log('s',this.inputForm)
+							if (this.status === 'audit' || this.status === 'taskFormDetail') {
+								method = 'view'
+							}
+							console.log('me',method)
+							this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'jyHoliday',null,null,null,null,null)
+							this.loading = false
+						})
+
+					}
+				})
+			},
+			saveForm(callback) {
+				this.doSubmit('save', callback)
+			},
+			startForm(callback) {
+				this.loading = true
+				if (this.commonJS.isNotEmpty(this.inputForm.id)) {
+					this.holidayService.queryById(this.inputForm.id).then((data) => {
+						if (data.status !== '0' && data.status !== '1' && data.status !== '3') { // 审核状态不是“未发起”或“暂存”或“撤回”,就弹出提示
+							this.loading = false
+							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+							throw new Error()
+						} else {
+							this.doSubmit('start', callback)
+						}
+					})
+				} else {
+					this.doSubmit('start', callback)
+				}
+			},
+			async agreeForm(callback) {
+				console.log('进入方法')
+				this.loading = true
+				await this.holidayService.queryById(this.inputForm.id).then((data) => {
+					if (data.status !== '2' ) { // status的值不等于“审核中”,就弹出提示
+						this.loading = false
+						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						throw new Error()
+					} else {
+						this.inputForm.status= '2'
+						if (this.inputForm.days>1){
+							this.commonApi.getTaskNameByProcInsId(this.inputForm.procInsId).then((da)=>{
+								if (this.commonJS.isNotEmpty(da)) {
+									if (da === '总经理审核') {
+										this.inputForm.status = '5'
+									}
+								}
+								let param = {status: this.inputForm.status, id: this.inputForm.id}
+								this.inputForm=JSON.stringify(this.inputForm)
+								this.holidayService.updateStatusById(param).then(() => {
+									callback(data.businessTable, data.businessId, this.inputForm,data.days)
+									this.loading = false
+								}).catch(() => {
+									this.loading = false
+								})
+							})
+						}else {
+							this.inputForm.status= '5'
+							let param = {status: this.inputForm.status, id: this.inputForm.id}
+							this.inputForm=JSON.stringify(this.inputForm)
+							this.holidayService.updateStatusById(param).then(() => {
+								callback(data.businessTable, data.businessId, this.inputForm,data.days)
+								this.loading = false
+							}).catch(() => {
+								this.loading = false
+							})
+						}
+
+					}
+				})
+			},
+			reapplyForm(callback) {
+				this.loading = true
+				this.holidayService.queryById(this.inputForm.id).then((data) => {
+					if (data.status !== '4') { // 审核状态不是“驳回”,就弹出提示
+						this.loading = false
+						this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+						throw new Error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+					} else {
+						this.doSubmit('reapply', callback)
+					}
+				})
+			},
+			// 表单提交
+			async doSubmit(status, callback) {
+				this.loading = true
+				console.log('5',this.inputForm)
+				if (status === 'save') {
+					// 暂存
+					this.loading = true
+					this.inputForm.status = '1'
+					if (this.$refs.uploadComponent.checkProgress()) {
+						this.loading = false
+						return
+					}
+					this.inputForm.files = this.$refs.uploadComponent.getDataList()
+					this.holidayService.saveForm(this.inputForm).then((data) => {
+						callback(data.businessTable, data.businessId, this.inputForm,data.days)
+						this.loading = false
+					}).catch(() => {
+						this.loading = false
+					})
+					return
+				} else if (status === 'start') {
+
+					if (this.commonJS.isEmpty(this.inputForm.startDay) || this.commonJS.isEmpty(this.inputForm.beginTime)){
+						this.$message.error('请选择开始时间')
+						this.loading = false
+					}
+					if (this.commonJS.isEmpty(this.inputForm.endDay) || this.commonJS.isEmpty(this.inputForm.endTime)){
+						this.$message.error('请选择结束时间')
+						this.loading = false
+					}
+					if (this.commonJS.isEmpty(this.inputForm.type)){
+						this.$message.error('请选择请假类型')
+						this.loading = false
+					}
+					if (this.$refs.uploadComponent.checkProgress()) {
+						this.loading = false
+						return
+					}
+					this.inputForm.files = this.$refs.uploadComponent.getDataList()
+					// 送审  待审核
+					this.inputForm.status = '2'
+				} else if (status === 'agree') {
+					this.inputForm.status= '5'
+				} else if (status === 'reapply') {
+					this.inputForm.status = '2'
+				}
+				this.$refs['inputForm'].validate((valid) => {
+					if (valid) {
+						this.loading = true
+						console.log('form',this.inputForm)
+						this.inputForm=JSON.parse(JSON.stringify(this.inputForm))
+						this.holidayService.saveForm(this.inputForm).then((data) => {
+							callback(data.businessTable, data.businessId, this.inputForm)
+							this.$refs.inputForm.resetFields()
+							this.loading = false
+						}).catch(() => {
+							this.$refs.inputForm.resetFields()
+							this.loading = false
+						})
+					} else {
+						this.loading = false
+					}
+				})
+			},
+			close() {
+				this.inputForm = {
+					id:'',
+					projectList:[],
+					name:'',
+					no:'',
+					projectLeader:'',
+					projectCreateDate:'',
+					createById:'',
+					createByName:'',
+					createDate:'',
+					remarks:'',
+					files: [], // 附件信息
+					types:[], //用印类型
+					number:'', //用印份数
+					projectId:'',
+				}
+				this.visible = false
+			},
+			async updateStatusById(type, callback) {
+				this.loading = true
+				if (type === 'reject' || type === 'reback') {
+					this.holidayService.queryById(this.inputForm.id).then((data) => {
+						if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+							this.loading = false
+							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+							throw new Error()
+						} else {
+							// if (type === 'agree') {
+							//   // 同意
+							//   this.inputForm.status = '5'
+							// }
+							if (type === 'reject') {
+								// 驳回
+								this.inputForm.status = '4'
+							}
+							if (type === 'reback') {
+								// 撤回
+								this.inputForm.status = '3'
+							}
+							if (type === 'reject' || type === 'reback') {
+								let param = {status: this.inputForm.status, id: this.inputForm.id}
+								this.holidayService.updateStatusById(param).then(() => {
+									this.loading = false
+									callback()
+								})
+							}
+						}
+					})
+				} else if (type === 'hold') {
+					this.holidayService.queryById(this.inputForm.id).then((data) => {
+						if (data.status !== '4') { // status的值不等于“驳回”就弹出提示
+							this.loading = false
+							this.$message.error('任务数据已发生改变或不存在,请在待办任务中确认此任务是否存在')
+							throw new Error()
+						} else {
+							// 终止
+							let param = {status: '1', id: this.inputForm.id}
+							this.holidayService.updateStatusById(param).then(() => {
+								this.loading = false
+								callback()
+							})
+						}
+					})
+				}
+
+			},
+			checkType(){
+				if (this.inputForm.type === '1'){
+					this.holidayService.checkType(this.inputForm).then((data)=>{
+							console.log('data',data)
+						this.$message.error(data)
+						throw new Error()
+
+					})
+				}
+			},
+			checkTime(){
+				let differenceInDays =''
+				let date1=new Date(this.inputForm.startDay)
+				let date2=new Date(this.inputForm.endDay)
+				if ((date2<date1) || (date2 === date1 && this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午')){
+					this.$message.error('开始时间不能小于结束时间')
+					throw new Error()
+				}
+				differenceInDays= Math.floor((date2 - date1) / (1000 * 60 * 60 * 24));
+				if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '下午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '上午') ){
+					differenceInDays=differenceInDays+1
+				}else if ((this.inputForm.beginTime === '上午' && this.inputForm.endTime === '上午') ||(this.inputForm.beginTime === '下午' && this.inputForm.endTime === '下午')){
+					differenceInDays=differenceInDays+0.5
+				}
+
+				console.log('differenceInDays',differenceInDays)
+				this.inputForm.days = differenceInDays
+			}
+
+		}
+
+	}
+</script>
+<style scoped>
+	/deep/ .el-input-number .el-input__inner {
+		text-align: left;
+	}
+	/deep/ .vxe-footer--row .vxe-footer--column:nth-child(1) .vxe-cell--item {
+		font-weight:700;
+	}
+</style>

+ 457 - 0
src/views/jy/holiday/HolidayList.vue

@@ -0,0 +1,457 @@
+<template>
+	<div class="page">
+		<el-form :inline="true"  v-if="searchVisible" class="query-form m-b-10" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+			<!-- 搜索框-->
+			<el-form-item label="请假类型" prop="type">
+				<el-select v-model="searchForm.type" placeholder="请选择" style="width:100%;">
+					<el-option
+						v-for="item in $dictUtils.getDictList('jy_holiday_type')"
+						:key="item.value"
+						:label="item.label"
+						:value="item.value">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item v-if="showHideItem" label="请假人" prop="createById">
+				<UserSelectSignatory style="width: 100%" ref="userSelect2" :limit="1"
+									 :readonly="true" :modelValue="searchForm.createById"
+									 @update:modelValue='(value) => {searchForm.createById = value}'></UserSelectSignatory>			</el-form-item>
+			<el-form-item v-if="showHideItem"  prop="officeId" label="请假人部门">
+				<SelectTree
+					ref="officeTree"
+					:props="{
+                  value: 'id',             // ID字段名
+                  label: 'name',         // 显示名称
+                  children: 'children'    // 子级字段名
+                }"
+
+					:url="`/system-server/sys/office/treeData?type=2`"
+					:value="searchForm.officeId"
+					size="default"
+					:accordion="true"
+					@getValue="(value) => {searchForm.officeId=value}"/>
+			</el-form-item>
+
+			<el-form-item v-if="showHideItem" label="请假日期" prop="dates">
+				<el-date-picker
+					placement="bottom-start"
+					format="YYYY-MM-DD"
+					value-format="YYYY-MM-DD"
+					v-model="searchForm.dates"
+					type="daterange"
+					range-separator="至"
+					start-placeholder="开始日期"
+					end-placeholder="结束日期">
+				</el-date-picker>
+			</el-form-item>
+
+
+			<el-form-item>
+				<el-button type="default" @click="showHide" :icon="showHideIcon">{{showHideName}}</el-button>
+				<el-button type="primary" @click="refreshList()" icon="el-icon-search">查询</el-button>
+				<el-button @click="resetSearch()" icon="el-icon-refresh-right">重置</el-button>
+			</el-form-item>
+		</el-form>
+		<div class="jp-table top" style="">
+			<vxe-toolbar :refresh="{query: refreshList}" custom>
+				<template #buttons>
+					<el-button v-if="hasPermission('evection:add')" :disabled="isAdmin" type="primary" icon="el-icon-plus" @click="add()">新建</el-button>
+				</template>
+				<template #tools>
+					<vxe-button
+						text
+						type="primary"
+						:title="searchVisible ? '收起检索' : '展开检索'"
+						icon="vxe-icon-search"
+						class="tool-btn"
+						@click="searchVisible = !searchVisible"
+					></vxe-button>
+				</template>
+			</vxe-toolbar>
+			<div style="height: calc(100% - 90px)">
+				<vxe-table
+					border="inner"
+					auto-resize
+					resizable
+					height="auto"
+					:loading="loading"
+					ref="clientTable"
+					show-header-overflow
+					show-overflow
+					highlight-hover-row
+					:menu-config="{}"
+					@sort-change="sortChangeHandle"
+					:sort-config="{remote:true}"
+					:data="dataList"
+					:checkbox-config="{}">
+					<vxe-column type="seq" width="60" title="序号"></vxe-column>
+					<vxe-column min-width="160" align="center" title="请假类型" field="type">
+						<template #default="scope">
+							{{ $dictUtils.getDictLabel("jy_holiday_type", scope.row.type, '-') }}
+						</template>
+					</vxe-column>
+					<vxe-column min-width="160" align="center" title="请假日期" field="startDay"></vxe-column>
+					<vxe-column min-width="160" align="center" title="请假时长" field="days"></vxe-column>
+					<vxe-column min-width="160" align="center" title="请假人" field="createName"></vxe-column>
+					<vxe-column min-width="160" align="center" title="请假人部门" field="officeName"></vxe-column>
+					<vxe-column min-width="160" align="center" title="请假时间" field="createTime"></vxe-column>
+					<vxe-column  min-width="150px" align="center" title="请假状态" field="status" fixed="right">
+						<template #default="scope">
+							<el-button @click="detail(scope.row)" :type="$dictUtils.getDictLabel('program_project_list_info_status_info', scope.row.status, '')" effect="dark" >{{$dictUtils.getDictLabel("program_project_list_info_status", scope.row.status, '未登记')}} </el-button>
+						</template>
+					</vxe-column>
+					<vxe-column title="操作" width="150px" fixed="right" align="center">
+						<template  #default="scope">
+							<div v-if="isAdmin">
+								<el-button text type="primary" size="small" v-if="scope.row.status==='0' || scope.row.status==='5'" @click="del(scope.row.id)">删除</el-button>
+								<el-button  size="small" text type="primary"  @click="adminEdit(scope.row)">修改</el-button>
+							</div>
+							<div v-else>
+								<el-button text type="primary" size="small" v-if="scope.row.status==='0' || scope.row.status==='1'|| scope.row.status==='3'" @click="del(scope.row.id)">删除</el-button>
+								<el-button v-if="(scope.row.status === '0'||scope.row.status === '1'|| scope.row.status === '3')" size="small" text type="primary"  @click="edit(scope.row)">修改</el-button>
+								<!--              当前申请人撤回-->
+								<el-button v-if="scope.row.createById === $store.state.user.id && scope.row.status==='2'" text type="primary" size="small" @click="reback(scope.row)">撤回</el-button>
+
+								<el-button v-if="scope.row.status==='2' && checkIsAudit(scope.row)" text type="primary" size="small" @click="examine(scope.row)">审核</el-button>
+								<el-button v-if="scope.row.status === '4'&&scope.row.createById === $store.state.user.id" text type="primary" size="small" @click="adjust(scope.row)">驳回调整</el-button>
+							</div>
+						</template>
+					</vxe-column>
+				</vxe-table>
+				<vxe-pager
+					background
+					:current-page="tablePage.currentPage"
+					:page-size="tablePage.pageSize"
+					:total="tablePage.total"
+					:page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+					:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+					@page-change="currentChangeHandle">
+				</vxe-pager>
+
+			</div>
+		</div>
+			<HolidayDia ref="holidayDia" @refreshList="refreshList"></HolidayDia>
+	</div>
+
+</template>
+
+<script>
+	import UserSelect from '@/components/userSelect'
+	import SelectTree from '@/components/treeSelect/treeSelect.vue'
+	import HolidayService from '@/api/jy/HolidayService'
+	import taskService from '@/api/flowable/taskService'
+	import processService from '@/api/flowable/processService'
+	import userService from '@/api/sys/userService'
+	import pick from 'lodash.pick'
+	import SupplierChooseForm from '@/views/materialManagement/supplier/SupplierChooseForm'
+	import UserSelectSignatory from '../workClientInfo/clientUserSelect'
+	import HolidayDia from './HolidayDia'
+	export default {
+		data () {
+			return {
+				dialogTableVisible:false,
+				searchVisible: true,
+				showHideItem: false,
+				showHideIcon: 'el-icon-arrow-down',
+				showHideName: '展示',
+				num: 0,
+				searchForm: {
+					officeId: '',
+					createById: '',
+					dates:[],
+					type:''
+				},
+				dataList: [],
+				tablePage: {
+					total: 0,
+					currentPage: 1,
+					pageSize: 10,
+					orders: []
+				},
+				tableKey: '',
+				loading: false,
+				processDefinitionId: '',
+				procDefKey: '',
+				isAdmin: false,
+				create: '',
+				gridData:[],
+				typeData:[]
+			}
+		},
+		HolidayService:null,
+		created () {
+			this.holidayService=new HolidayService()
+		},
+		components: {
+			SelectTree,
+			UserSelect,
+			SupplierChooseForm,
+			UserSelectSignatory,
+			HolidayDia,
+
+		},
+		computed: {
+			userName () {
+				return this.$store.state.user.name
+			},
+			user () {
+				this.createName = this.$store.state.user.name
+				return this.$store.state.user
+			}
+		},
+		mounted () {
+			this.refreshList()
+		},
+		activated () {
+			this.refreshList()
+		},
+		methods: {
+			showHide () {
+				if (this.showHideItem === false) {
+					this.showHideItem = true
+					this.showHideIcon = 'el-icon-arrow-up'
+					this.showHideName = '隐藏'
+				} else {
+					this.showHideItem = false
+					this.showHideIcon = 'el-icon-arrow-down'
+					this.showHideName = '展示'
+				}
+			},
+			// 新增
+			add () {
+				// 读取流程表单
+				let tabTitle = `发起流程【嘉溢-请假申请】`
+				let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [嘉溢-请假申请]`
+				taskService.getTaskDef({ procDefId: this.processDefinitionId,
+					status: 'startAndHold'}).then((data) => {
+					this.$router.push({
+						path: '/flowable/task/TaskForm',
+						query: {
+							...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+							procDefId: this.processDefinitionId,
+							procDefKey: this.procDefKey,
+							status: 'startAndHold',
+							title: tabTitle,
+							formType: data.formType,
+							formUrl: data.formUrl,
+							formTitle: processTitle,
+							businessId: 'false',
+							isShow: false,
+							routePath: '/jy/holiday/HolidayList'
+						}
+					})
+				})
+			},
+			// 修改
+			edit (row) {
+				let tabTitle = `发起流程【嘉溢-请假申请】`
+				let processTitle = `${this.userName} 在 ${this.moment(new Date()).format('YYYY-MM-DD HH:mm')} 发起了 [嘉溢-请假申请]`
+				taskService.getTaskDef({ procDefId: this.processDefinitionId,
+					businessId: row.id,
+					businessTable: 'jy_holiday',
+					status: 'startAndHold'}).then((data) => {
+					this.$router.push({
+						path: '/flowable/task/TaskForm',
+						query: {
+							...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+							procDefId: this.processDefinitionId,
+							procDefKey: this.procDefKey,
+							status: 'startAndHold',
+							title: tabTitle,
+							formType: data.formType,
+							formUrl: data.formUrl,
+							formTitle: processTitle,
+							businessId: row.id,
+							businessTable: 'jy_holiday',
+							isShow: false,
+							routePath: '/jy/holiday/HolidayList'
+						}
+					})
+				})
+			},
+			// 查看
+			view (row) {
+				this.$refs.goOutEditForm.init('view',row.id);
+
+			},
+			// 查询当前用户是否是管理员用户
+			checkIsAdmin () {
+				userService.is().then((data) => {
+					this.isAdmin = data
+				})
+			},
+			// 获取数据列表
+			refreshList () {
+				this.loading = true
+				this.holidayService.list({
+					'current': this.tablePage.currentPage,
+					'size': this.tablePage.pageSize,
+					'orders': this.tablePage.orders,
+					...this.searchForm
+				}).then((data) => {
+					console.log('x',data.records)
+					this.dataList = data.records
+					this.tablePage.total = data.total
+					this.tableKey = Math.random()
+					this.loading = false
+				})
+				this.checkIsAdmin()
+				processService.getByName('嘉溢-请假申请').then((data) => {
+					console.log('data',data)
+					if (!this.commonJS.isEmpty(data.id)) {
+						this.processDefinitionId = data.id
+						this.procDefKey = data.key
+					}
+				})
+			},
+			// 当前页
+			currentChangeHandle ({ currentPage, pageSize }) {
+				this.tablePage.currentPage = currentPage
+				this.tablePage.pageSize = pageSize
+				this.refreshList()
+			},
+			// 排序
+			sortChangeHandle (column) {
+				this.tablePage.orders = []
+				if (column.order != null) {
+					this.tablePage.orders.push({column: this.$utils.toLine(column.property), asc: column.order === 'asc'})
+				}
+				this.refreshList()
+			},
+			// 删除
+			del (id) {
+				let ids = id || this.$refs.clientTable.getCheckboxRecords().map(item => {
+					return item.id
+				}).join(',')
+				this.$confirm(`确定删除所选项吗?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.loading = true
+					this.holidayService.delete(ids).then((data) => {
+						this.$message.success(data)
+						this.refreshList()
+						this.loading = false
+					})
+				})
+			},
+			resetSearch () {
+				this.$refs.searchForm.resetFields()
+				this.searchForm.projectId = '' // 重置时清空项目id
+				this.refreshList()
+			},
+
+			// 查看修改流程结果
+			detail (row) {
+				if (row.status !== '0' && row.status !== '1') {
+					this.holidayService.queryById(row.id).then((da)=>{
+						// eslint-disable-next-line eqeqeq
+						taskService.getTaskDef({
+							procInsId: row.procInsId,
+							procDefId: this.processDefinitionId
+						}).then((data) => {
+							this.$router.push({
+								path: '/flowable/task/TaskFormDetail',
+								query: {
+									...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title'),
+									isShow: 'false',
+									readOnly: true,
+									title: '请假申请' + '流程详情',
+									formTitle: '请假申请' + '流程详情',
+									businessId: row.id,
+									status: 'reback',
+									method: 'view'
+								}
+							})
+						})
+					})
+				}
+			},
+			// 撤回入库修改
+			reback (row) {
+				this.$confirm(`确定要撤回该申请吗?`, '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.holidayService.queryById(row.id).then((data) => {
+						if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+							this.$message.error('数据已发生改变或不存在,请刷新数据')
+							this.refreshList()
+						} else {
+							processService.revokeProcIns(row.procInsId).then((data) => {
+								let form = {status: '3', id: row.id}
+								this.holidayService.updateStatusById(form)
+								this.$message.success(data)
+								this.refreshList()
+							})
+						}
+					})
+				})
+			},
+			// 驳回后调整
+			adjust (row) {
+				this.holidayService.queryById(row.id).then((data) => {
+					if (data.status !== '4') { // status的值不等于“驳回”,就弹出提示
+						this.$message.error('数据已发生改变或不存在,请刷新数据')
+						this.refreshList()
+					} else {
+						this.todo(row)
+					}
+				})
+			},
+			// 审核
+			examine (row) {
+				this.holidayService.queryById(row.id).then((data) => {
+					if (data.status !== '2') { // status的值不等于“审核中”,就弹出提示
+						this.$message.error('数据已发生改变或不存在,请刷新数据')
+						this.refreshList()
+					} else {
+						this.todo(row)
+					}
+				})
+			},
+			// 审核或重新调整跳转
+			todo (row) {
+				let cUser = false
+				taskService.getTaskDefInfo({
+					taskId: row.taskId
+				}).then((data) => {
+					this.$router.push({
+						path: '/flowable/task/TaskForm',
+						query: {
+							...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId'),
+							isShow: false,
+							formReadOnly: true,
+							formTitle: `${data.taskName}`,
+							cUser: cUser,
+							title: `审批【${data.taskName || ''}】`,
+							routePath: '/jy/holiday/HolidayList',   // 数据处理后需要跳转的页面路径
+						}
+					})
+				})
+			},
+			// 查询当前登录人是否是数据的审核人
+			checkIsAudit (row) {
+				let loginUserId = this.$store.state.user.id  // 获取当前登录用户id
+				if (this.commonJS.isNotEmpty(row.auditUserIds)) {
+					for (const userId of row.auditUserIds) {
+						if (userId === loginUserId) {  // 当数据的审核人中包含当前登录人id时,返回true
+							return true
+						}
+					}
+				}
+				return false
+			},
+
+			adminEdit(row){
+				this.$refs.holidayDia.init('edit',row.id);
+			},
+
+
+
+
+		}
+	}
+</script>