假期问题修复
This commit is contained in:
@@ -8,6 +8,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
import com.alibaba.excel.util.DateUtils;
|
import com.alibaba.excel.util.DateUtils;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysHolidayVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaHolidayListVo;
|
import com.ruoyi.oa.domain.vo.SysOaHolidayListVo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -141,4 +142,9 @@ public class SysOaHolidayController extends BaseController {
|
|||||||
public R<Void> updateHolidayStatusByDate(Integer type, @NotNull(message = "起始日期不能为空") Date startDate, @NotNull(message = "结束日期不能为空")Date endDate){
|
public R<Void> updateHolidayStatusByDate(Integer type, @NotNull(message = "起始日期不能为空") Date startDate, @NotNull(message = "结束日期不能为空")Date endDate){
|
||||||
return toAjax(iSysOaHolidayService.updateHolidayStatusByDate(type, startDate, endDate));
|
return toAjax(iSysOaHolidayService.updateHolidayStatusByDate(type, startDate, endDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/queryList")
|
||||||
|
public R<List<SysHolidayVo>> queryList(SysOaHolidayBo bo){
|
||||||
|
return R.ok(iSysOaHolidayService.queryVoList(bo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.oa.domain.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ruoyi.oa.domain.SysOaHoliday;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SysHolidayVo {
|
||||||
|
|
||||||
|
private String holidayName;
|
||||||
|
|
||||||
|
private String holidayType;
|
||||||
|
|
||||||
|
private List<SysOaHoliday> holidayVoList;
|
||||||
|
|
||||||
|
private String holidayTimeString;
|
||||||
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
package com.ruoyi.oa.mapper;
|
package com.ruoyi.oa.mapper;
|
||||||
|
|
||||||
import com.ruoyi.oa.domain.SysOaHoliday;
|
import com.ruoyi.oa.domain.SysOaHoliday;
|
||||||
|
import com.ruoyi.oa.domain.bo.SysOaHolidayBo;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysHolidayVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaHolidayVo;
|
import com.ruoyi.oa.domain.vo.SysOaHolidayVo;
|
||||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 休假管理Mapper接口
|
* 休假管理Mapper接口
|
||||||
*
|
*
|
||||||
@@ -12,4 +16,5 @@ import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
|||||||
*/
|
*/
|
||||||
public interface SysOaHolidayMapper extends BaseMapperPlus<SysOaHolidayMapper, SysOaHoliday, SysOaHolidayVo> {
|
public interface SysOaHolidayMapper extends BaseMapperPlus<SysOaHolidayMapper, SysOaHoliday, SysOaHolidayVo> {
|
||||||
|
|
||||||
|
List<SysHolidayVo> queryVoList(SysOaHolidayBo bo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.oa.service;
|
package com.ruoyi.oa.service;
|
||||||
|
|
||||||
|
import com.ruoyi.oa.domain.vo.SysHolidayVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaHolidayListVo;
|
import com.ruoyi.oa.domain.vo.SysOaHolidayListVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaHolidayVo;
|
import com.ruoyi.oa.domain.vo.SysOaHolidayVo;
|
||||||
import com.ruoyi.oa.domain.bo.SysOaHolidayBo;
|
import com.ruoyi.oa.domain.bo.SysOaHolidayBo;
|
||||||
@@ -71,4 +72,5 @@ public interface ISysOaHolidayService {
|
|||||||
Boolean updateHolidayStatusByDate(Integer type, Date startDate, Date endDate);
|
Boolean updateHolidayStatusByDate(Integer type, Date startDate, Date endDate);
|
||||||
|
|
||||||
|
|
||||||
|
List<SysHolidayVo> queryVoList(SysOaHolidayBo bo);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.PageQuery;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.ruoyi.oa.domain.vo.SysHolidayVo;
|
||||||
import com.ruoyi.oa.domain.vo.SysOaHolidayListVo;
|
import com.ruoyi.oa.domain.vo.SysOaHolidayListVo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -17,6 +18,7 @@ import com.ruoyi.oa.domain.SysOaHoliday;
|
|||||||
import com.ruoyi.oa.mapper.SysOaHolidayMapper;
|
import com.ruoyi.oa.mapper.SysOaHolidayMapper;
|
||||||
import com.ruoyi.oa.service.ISysOaHolidayService;
|
import com.ruoyi.oa.service.ISysOaHolidayService;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.YearMonth;
|
import java.time.YearMonth;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
@@ -157,7 +159,7 @@ public class SysOaHolidayServiceImpl implements ISysOaHolidayService {
|
|||||||
Date endDate = DateUtils.addDays(result.getHolidayTime(), days - 1);
|
Date endDate = DateUtils.addDays(result.getHolidayTime(), days - 1);
|
||||||
VoList.add(new SysOaHolidayListVo(result.getHolidayId(), result.getName(), result.getHolidayTime(), endDate, days, result.getType()));
|
VoList.add(new SysOaHolidayListVo(result.getHolidayId(), result.getName(), result.getHolidayTime(), endDate, days, result.getType()));
|
||||||
}
|
}
|
||||||
|
System.out.println(VoList);
|
||||||
return VoList;
|
return VoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,6 +199,33 @@ public class SysOaHolidayServiceImpl implements ISysOaHolidayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按照节假日分类方式查找列表
|
||||||
|
* @param bo
|
||||||
|
* @return list列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SysHolidayVo> queryVoList(SysOaHolidayBo bo) {
|
||||||
|
List<SysHolidayVo> list = baseMapper.queryVoList(bo);
|
||||||
|
for (SysHolidayVo sysHolidayVo : list) {
|
||||||
|
List<SysOaHoliday> holidayVoList = sysHolidayVo.getHolidayVoList();
|
||||||
|
SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < holidayVoList.size(); i++) {
|
||||||
|
// 格式化日期
|
||||||
|
System.out.println(holidayVoList.get(i).getHolidayTime());
|
||||||
|
String formattedDate = SDF.format(holidayVoList.get(i).getHolidayTime());
|
||||||
|
sb.append(formattedDate);
|
||||||
|
// 在每个日期后面加逗号(最后一个日期后面可选)
|
||||||
|
if (i < holidayVoList.size() - 1) {
|
||||||
|
sb.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sysHolidayVo.setHolidayTimeString( sb.toString());
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,5 +17,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<result property="delFlag" column="del_flag"/>
|
<result property="delFlag" column="del_flag"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.oa.domain.vo.SysHolidayVo" id="SysOaHolidayVoResult">
|
||||||
|
<result property="holidayType" column="type"/>
|
||||||
|
<result property="holidayName" column="name"/>
|
||||||
|
<collection property="holidayVoList" ofType="com.ruoyi.oa.domain.SysOaHoliday">
|
||||||
|
<result property="holidayTime" column="holiday_time"/>
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="queryVoList" resultMap="SysOaHolidayVoResult">
|
||||||
|
SELECT
|
||||||
|
soh.name,
|
||||||
|
soh.type,
|
||||||
|
soh.holiday_time
|
||||||
|
FROM sys_oa_holiday soh
|
||||||
|
where soh.type !='0'
|
||||||
|
ORDER BY soh.name, soh.type,soh.holiday_time
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -719,8 +719,6 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
detailVo.setTaskFormData(currTaskFormData(historicProcIns.getDeploymentId(), taskIns));
|
detailVo.setTaskFormData(currTaskFormData(historicProcIns.getDeploymentId(), taskIns));
|
||||||
}
|
}
|
||||||
// 获取Bpmn模型信息
|
// 获取Bpmn模型信息
|
||||||
System.out.println("--------------------------");
|
|
||||||
System.out.println(historicProcIns);
|
|
||||||
InputStream inputStream = repositoryService.getProcessModel(historicProcIns.getProcessDefinitionId());
|
InputStream inputStream = repositoryService.getProcessModel(historicProcIns.getProcessDefinitionId());
|
||||||
String bpmnXmlStr = StrUtil.utf8Str(IoUtil.readBytes(inputStream, false));
|
String bpmnXmlStr = StrUtil.utf8Str(IoUtil.readBytes(inputStream, false));
|
||||||
BpmnModel bpmnModel = ModelUtils.getBpmnModel(bpmnXmlStr);
|
BpmnModel bpmnModel = ModelUtils.getBpmnModel(bpmnXmlStr);
|
||||||
@@ -977,7 +975,6 @@ public class WfProcessServiceImpl extends FlowServiceFactory implements IWfProce
|
|||||||
} else if (identityLink.getGroupId().startsWith(TaskConstants.DEPT_GROUP_PREFIX)) {
|
} else if (identityLink.getGroupId().startsWith(TaskConstants.DEPT_GROUP_PREFIX)) {
|
||||||
Long deptId = Long.parseLong(StringUtils.stripStart(identityLink.getGroupId(), TaskConstants.DEPT_GROUP_PREFIX));
|
Long deptId = Long.parseLong(StringUtils.stripStart(identityLink.getGroupId(), TaskConstants.DEPT_GROUP_PREFIX));
|
||||||
SysDept dept = deptService.selectDeptById(deptId);
|
SysDept dept = deptService.selectDeptById(deptId);
|
||||||
System.out.println(dept);
|
|
||||||
stringBuilder.append(dept.getDeptName()).append(",");
|
stringBuilder.append(dept.getDeptName()).append(",");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,15 @@ export function listOaHoliday(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询休假管理列表
|
||||||
|
export function queryListHoliday(query) {
|
||||||
|
return request({
|
||||||
|
url: '/oa/oaHoliday/queryList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询休假管理详细
|
// 查询休假管理详细
|
||||||
export function getOaHoliday(holidayId) {
|
export function getOaHoliday(holidayId) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -2,12 +2,24 @@
|
|||||||
<el-card>
|
<el-card>
|
||||||
<h2>快捷入口</h2>
|
<h2>快捷入口</h2>
|
||||||
<div class="shortcut" v-for="(item, index) in shortcuts" :key="index">
|
<div class="shortcut" v-for="(item, index) in shortcuts" :key="index">
|
||||||
<el-button type="primary" :icon="item.icon" @click="goTarget(item.url)">{{ item.name }}</el-button>
|
|
||||||
|
<el-badge :hidden="total===0" :value="total" class="item" v-if="item.name==='待办任务'">
|
||||||
|
<el-button type="primary" :icon="item.icon" @click="goTarget(item.url)">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-button>
|
||||||
|
</el-badge>
|
||||||
|
|
||||||
|
<el-button type="primary" :icon="item.icon" v-else @click="goTarget(item.url)">
|
||||||
|
{{ item.name }}
|
||||||
|
</el-button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {listTodoProcess} from "../../api/workflow/process";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'QuickAccess',
|
name: 'QuickAccess',
|
||||||
data() {
|
data() {
|
||||||
@@ -16,7 +28,19 @@ export default {
|
|||||||
{ name: '人员考勤' ,url:'produce/attendance',icon:'el-icon-data-line'},
|
{ name: '人员考勤' ,url:'produce/attendance',icon:'el-icon-data-line'},
|
||||||
{ name: '日常财务' ,url:'finance/finance',icon:'el-icon-edit-outline'},
|
{ name: '日常财务' ,url:'finance/finance',icon:'el-icon-edit-outline'},
|
||||||
{ name: '出库管理' ,url:'ware/oaOutWarehouse',icon:'el-icon-document'},
|
{ name: '出库管理' ,url:'ware/oaOutWarehouse',icon:'el-icon-document'},
|
||||||
]
|
{ name: '待办任务' ,url:'work/todo',icon:'el-icon-s-unfold'},
|
||||||
|
],
|
||||||
|
// 日期范围
|
||||||
|
dateRange: [],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
name: null,
|
||||||
|
category: null,
|
||||||
|
description: null
|
||||||
|
},
|
||||||
|
total:0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -25,7 +49,22 @@ export default {
|
|||||||
this.$router.push({ path: href});
|
this.$router.push({ path: href});
|
||||||
console.log(999,href)
|
console.log(999,href)
|
||||||
},
|
},
|
||||||
|
/** 查询流程定义列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listTodoProcess(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||||
|
if(this.queryParams.description != null){
|
||||||
|
this.todoList = this.searchList(response.rows, this.queryParams.description);
|
||||||
|
}else {
|
||||||
|
this.todoList =response.rows;
|
||||||
|
}
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getList()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -150,28 +150,6 @@ export const constantRoutes = [
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
// {
|
|
||||||
// path: '/people/updateOffboarding/:offboardingId(\\d+)',
|
|
||||||
// component: () => import('@/views/oa/offboarding/update'),
|
|
||||||
// hidden: true,
|
|
||||||
// name: 'offboarding',
|
|
||||||
// meta: { title: '跟进离职流程', activeMenu: '/people/offboarding' }
|
|
||||||
// },
|
|
||||||
/* {
|
|
||||||
path: '/finance',
|
|
||||||
component: Layout,
|
|
||||||
hidden: true,
|
|
||||||
redirect: 'noredirect',
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'costing',
|
|
||||||
component: () => import('@/views/oa/costing/list'),
|
|
||||||
name: 'Profile',
|
|
||||||
meta: { title: '个人中心', icon: 'user' }
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}*/
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// 动态路由,基于用户权限动态去加载
|
// 动态路由,基于用户权限动态去加载
|
||||||
|
|||||||
@@ -3,62 +3,68 @@
|
|||||||
<el-tabs v-model="activeName" style="margin-left: 10px;">
|
<el-tabs v-model="activeName" style="margin-left: 10px;">
|
||||||
<el-tab-pane label="休假日历" name="first">
|
<el-tab-pane label="休假日历" name="first">
|
||||||
<el-calendar>
|
<el-calendar>
|
||||||
<template #dateCell="{ date, data }">
|
<template slot="dateCell" slot-scope="{date, data}">
|
||||||
<div :class="{'is-selected': data.isSelected, 'blue-background': isHoliday(data.day)}" @click="handleCellClick(data)">
|
<div :class="{'is-selected': data.isSelected, 'blue-background': isHoliday(data.day)}" style="height: 100%"
|
||||||
<p>{{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : '' }}</p>
|
@click="handleCellClick(data)">
|
||||||
<p v-if="isHoliday(data.day)" class="holiday-name">{{ getHolidayName(data.day) }}</p>
|
<div v-if="isHoliday(data.day)" class="holiday-name">
|
||||||
|
<div>{{ data.day.split('-').slice(1).join('-') }}</div>
|
||||||
|
<div> {{ getHolidayName(data.day) }}</div>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<div>{{ data.day.split('-').slice(1).join('-') }}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-calendar>
|
</el-calendar>
|
||||||
<el-spin v-if="loading" size="large" class="loading-spinner" />
|
<el-spin v-if="loading" size="large" class="loading-spinner"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="节假日列表" name="second">
|
<el-tab-pane label="节假日列表" name="second">
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="oaHolidayList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="oaHolidayList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="主键id" align="center" prop="holidayId" v-if="true"/>
|
<el-table-column label="序号" align="center" type="index" v-if="true"/>
|
||||||
<el-table-column label="0正常1周日2节假日3调休" align="center" prop="type" />
|
<el-table-column label="假期名称" align="center" prop="holidayName"/>
|
||||||
<el-table-column label="假期日期" align="center" prop="holidayTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
<el-table-column label="涉及日期" align="center" prop="holidayTimeString" width="500" :show-overflow-tooltip='true'>
|
||||||
<span>{{ parseTime(scope.row.holidayTime, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
<el-table-column label="类型" align="center" prop="holidayType">
|
||||||
<el-table-column label="假期名称" align="center" prop="name" />
|
<template slot-scope="scope">
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<el-tag v-if="scope.row.holidayType==1">周日</el-tag>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-tag v-if="scope.row.holidayType==2">节假日</el-tag>
|
||||||
<template slot-scope="scope">
|
<el-tag v-if="scope.row.holidayType==3">调休</el-tag>
|
||||||
<el-button
|
</template>
|
||||||
size="mini"
|
</el-table-column>
|
||||||
type="text"
|
</el-table>
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
<!-- <pagination-->
|
||||||
v-hasPermi="['oa:oaHoliday:edit']"
|
<!-- v-show="total>0"-->
|
||||||
>修改</el-button>
|
<!-- :total="total"-->
|
||||||
<el-button
|
<!-- :page.sync="queryParams.pageNum"-->
|
||||||
size="mini"
|
<!-- :limit.sync="queryParams.pageSize"-->
|
||||||
type="text"
|
<!-- @pagination="getList"-->
|
||||||
icon="el-icon-delete"
|
<!-- />-->
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['oa:oaHoliday:remove']"
|
</el-tab-pane>
|
||||||
>删除</el-button>
|
</el-tabs>
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加或修改休假管理对话框 -->
|
<!-- 添加或修改休假管理对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
<el-form-item label="假期日期" prop="holidayTime">
|
<el-form-item label="假期日期" prop="holidayTime">
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable
|
||||||
v-model="form.holidayTime"
|
v-model="form.holidayTime"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="请选择假期日期">
|
placeholder="请选择假期日期">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="假期名称" prop="name">
|
<el-form-item label="假期名称" prop="name">
|
||||||
<el-input v-model="form.name" placeholder="请输入假期名称" />
|
<el-input v-model="form.name" placeholder="请输入假期名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="备注" prop="remark">
|
<el-form-item label="备注" prop="remark">
|
||||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@@ -68,26 +74,9 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
|
|
||||||
<el-dialog :visible.sync="dialogVisible" title="编辑日期类型" width="30%">
|
<el-dialog :visible.sync="dialogVisible" title="编辑日期类型" width="30%">
|
||||||
<el-form :model="currentHoliday" ref="form">
|
<el-form :model="currentHoliday" ref="form" label-width="80px">
|
||||||
<el-form-item label="选择类型">
|
<el-form-item label="选择类型" prop="">
|
||||||
<el-select v-model="currentHoliday.type" placeholder="请选择">
|
<el-select v-model="currentHoliday.type" placeholder="请选择">
|
||||||
<el-option label="工作日" :value="0"></el-option>
|
<el-option label="工作日" :value="0"></el-option>
|
||||||
<el-option label="休息日" :value="1"></el-option>
|
<el-option label="休息日" :value="1"></el-option>
|
||||||
@@ -95,6 +84,10 @@
|
|||||||
<el-option label="调休" :value="3"></el-option>
|
<el-option label="调休" :value="3"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="假期名称" prop="name">
|
||||||
|
<el-input v-model="currentHoliday.name" placeholder="请输入假期名称"/>
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取消</el-button>
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
@@ -105,7 +98,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listOaHoliday, updateOaHoliday } from "@/api/oa/oaHoliday";
|
import {listOaHoliday, updateOaHoliday,queryListHoliday} from "@/api/oa/oaHoliday";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@@ -115,12 +108,9 @@ export default {
|
|||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
currentHoliday: {},
|
currentHoliday: {},
|
||||||
loading: false, // New loading state
|
loading: false, // New loading state
|
||||||
|
// 按钮loading
|
||||||
|
buttonLoading: false,
|
||||||
// 按钮loading
|
|
||||||
buttonLoading: false,
|
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 非单个禁用
|
// 非单个禁用
|
||||||
@@ -140,7 +130,7 @@ export default {
|
|||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 999,
|
||||||
type: undefined,
|
type: undefined,
|
||||||
holidayTime: undefined,
|
holidayTime: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
@@ -150,40 +140,40 @@ export default {
|
|||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
holidayId: [
|
holidayId: [
|
||||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
{required: true, message: "主键id不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
type: [
|
type: [
|
||||||
{ required: true, message: "0正常1周日2节假日3调休不能为空", trigger: "change" }
|
{required: true, message: "0正常1周日2节假日3调休不能为空", trigger: "change"}
|
||||||
],
|
],
|
||||||
holidayTime: [
|
holidayTime: [
|
||||||
{ required: true, message: "假期日期不能为空", trigger: "blur" }
|
{required: true, message: "假期日期不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: "假期名称不能为空", trigger: "blur" }
|
{required: true, message: "假期名称不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
remark: [
|
remark: [
|
||||||
{ required: true, message: "备注不能为空", trigger: "blur" }
|
{required: true, message: "备注不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
delFlag: [
|
delFlag: [
|
||||||
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
{required: true, message: "删除标志不能为空", trigger: "blur"}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchHolidayData() {
|
fetchHolidayData() {
|
||||||
this.loading = true; // Set loading to true when fetching data
|
this.loading = true;
|
||||||
listOaHoliday({}).then(response => {
|
listOaHoliday({}).then(response => {
|
||||||
this.holidays = response.rows.map(item => ({
|
this.holidays = response.rows.map(item => ({
|
||||||
date: item.holidayTime.split(" ")[0],
|
date: item.holidayTime.split(" ")[0],
|
||||||
type: item.type,
|
type: item.type,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
fullData: item
|
fullData: item
|
||||||
}));
|
}));
|
||||||
this.loading = false; // Set loading to false once data is fetched
|
this.loading = false;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error("Error fetching holiday data:", error);
|
|
||||||
this.loading = false; // Set loading to false even on error
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
isHoliday(date) {
|
isHoliday(date) {
|
||||||
@@ -195,58 +185,37 @@ export default {
|
|||||||
return holiday ? holiday.name : '';
|
return holiday ? holiday.name : '';
|
||||||
},
|
},
|
||||||
handleCellClick(data) {
|
handleCellClick(data) {
|
||||||
|
|
||||||
const holiday = this.holidays.find(holiday => holiday.date === data.day);
|
const holiday = this.holidays.find(holiday => holiday.date === data.day);
|
||||||
if (holiday) {
|
this.currentHoliday = {...holiday.fullData, type: holiday.type};
|
||||||
this.currentHoliday = { ...holiday.fullData, type: holiday.type };
|
this.dialogVisible = true;
|
||||||
this.dialogVisible = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
updateHoliday() {
|
updateHoliday() {
|
||||||
switch (this.currentHoliday.type) {
|
|
||||||
case 0:
|
|
||||||
this.currentHoliday.name = null;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
this.currentHoliday.name = "休息日";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
this.currentHoliday.name = "节假日";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
this.currentHoliday.name = "调休";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
updateOaHoliday(this.currentHoliday).then(response => {
|
updateOaHoliday(this.currentHoliday).then(response => {
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
this.fetchHolidayData();
|
this.fetchHolidayData();
|
||||||
this.$message.success("假期类型更新成功");
|
this.$message.success("假期类型更新成功");
|
||||||
|
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error("Error updating holiday data:", error);
|
console.error("Error updating holiday data:", error);
|
||||||
this.$message.error("更新失败");
|
this.$message.error("更新失败");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/** 查询休假管理列表 */
|
/** 查询休假管理列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listOaHoliday(this.queryParams).then(response => {
|
queryListHoliday(this.queryParams).then(response => {
|
||||||
this.oaHolidayList = response.rows;
|
|
||||||
this.total = response.total;
|
this.oaHolidayList = response.data;
|
||||||
|
console.log(response)
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
// 取消按钮
|
// 取消按钮
|
||||||
cancel() {
|
cancel() {
|
||||||
this.open = false;
|
this.open = false;
|
||||||
@@ -281,7 +250,7 @@ export default {
|
|||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.holidayId)
|
this.ids = selection.map(item => item.holidayId)
|
||||||
this.single = selection.length!==1
|
this.single = selection.length !== 1
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length
|
||||||
},
|
},
|
||||||
/** 新增按钮操作 */
|
/** 新增按钮操作 */
|
||||||
@@ -356,8 +325,9 @@ export default {
|
|||||||
border: none !important;
|
border: none !important;
|
||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
transition: all 0.3s ease; /* Smooth transition for hover effect */
|
transition: all 0.3s ease; /* Smooth transition for hover effect */
|
||||||
}
|
}
|
||||||
|
|
||||||
.blue-background {
|
.blue-background {
|
||||||
background-color: #dcf2f2;
|
background-color: #dcf2f2;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
@@ -368,25 +338,30 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-calendar__cell p {
|
.el-calendar__cell p {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: 14px; /* Improve text size for better readability */
|
font-size: 14px; /* Improve text size for better readability */
|
||||||
}
|
}
|
||||||
|
|
||||||
.holiday-name {
|
.holiday-name {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #141313;
|
color: #141313;
|
||||||
text-align: center;
|
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-dialog {
|
.el-dialog {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-footer {
|
.dialog-footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.loading-spinner {
|
.loading-spinner {
|
||||||
display: block;
|
display: block;
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
|
|||||||
Reference in New Issue
Block a user