2 files added
7 files renamed
2 files modified
1 files deleted
| New file |
| | |
| | | package me.zhengjie.modules.quartz.task; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.quartz.service.OpaiDingTalkService; |
| | | import me.zhengjie.modules.system.domain.Role; |
| | | import me.zhengjie.modules.system.domain.SysConfigProportion; |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.SysConfigProportionRepository; |
| | | import me.zhengjie.modules.system.repository.SysUserContractRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.*; |
| | | import java.time.temporal.ChronoUnit; |
| | | import java.util.ArrayList; |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 合同是否到期提醒 |
| | | * @author 魏传栋 |
| | | * @date 2023-01-10 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ContractMethod { |
| | | |
| | | private final SysConfigProportionRepository sysConfigProportionRepository; |
| | | private final SysUserContractRepository sysUserContractRepository; |
| | | private final UserRepository userRepository; |
| | | private final OpaiDingTalkService opaiDingTalkService; |
| | | |
| | | // 合同到期提醒 |
| | | public void contractRemind() throws Exception { |
| | | // 今天日期 |
| | | Date today = new Date(); |
| | | // 钉钉Id |
| | | List<String> dingDingList = new ArrayList<>(); |
| | | // 查询用户 |
| | | List<User> userList = userRepository.findAll(); |
| | | for(User user : userList){ |
| | | // 获取用户角色 |
| | | Role role = user.getRoles().iterator().next(); |
| | | // 高级别 |
| | | if(Long.valueOf(role.getLevel()).equals(Constant.ROLE_LEVEL_SUPER) || Long.valueOf(role.getLevel()).equals(Constant.ROLE_LEVEL_GENERAL)){ |
| | | if(ObjectUtil.isNotEmpty(user.getDingding())){ |
| | | dingDingList.add(user.getDingding()); |
| | | } |
| | | } |
| | | } |
| | | // 查询配置表的合同到期提醒数值 |
| | | SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findByTitle("个人合同到期提醒"); |
| | | |
| | | // 查询合同 |
| | | List<SysUserContract> sysUserContractList = sysUserContractRepository.findAll(); |
| | | for(SysUserContract sysUserContract : sysUserContractList){ |
| | | // 当合同结束时间大于今天 |
| | | if(sysUserContract.getContractEndTime().compareTo(today) > 0){ |
| | | // 查询合同即将到期的员工 |
| | | User user1 = userRepository.findById(sysUserContract.getUserId()).orElseGet(User::new); |
| | | // date转LocalDateTime |
| | | Instant instant = today.toInstant(); |
| | | ZoneId zoneId = ZoneId.systemDefault(); |
| | | LocalDateTime todayLocalDateTime = instant.atZone(zoneId).toLocalDateTime(); |
| | | // 今天到合同结束时间的差值 |
| | | Long chronoUnit = ChronoUnit.DAYS.between(todayLocalDateTime.toLocalDate(), sysUserContract.getContractEndTime().toLocalDateTime().toLocalDate()); |
| | | Integer count = 0; |
| | | for (Integer i = 0; i <= chronoUnit; i++) { |
| | | count++; |
| | | } |
| | | // 相差天数等于配置表的数值时给高级别用户发钉钉信息 |
| | | if(Double.valueOf(count).equals(sysConfigProportion.getProportion())){ |
| | | opaiDingTalkService.sendNotice(dingDingList, "合同将到期提醒", "### 合同将到期提示 \n >" + |
| | | " \n 所属员工:" + user1.getNickName() + |
| | | " \n 合同名称: " + sysUserContract.getContractName() + |
| | | " \n 合同到期时间: " + sysUserContract.getContractEndTime().toString().substring(0,10) + |
| | | " \n 所属员工合同即将到期,请登录PMS系统查看。", "card"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SysContract.java |
| | |
| | | **/ |
| | | @Entity |
| | | @Data |
| | | @Table(name="sys_contract") |
| | | public class SysContract extends BaseEntity implements Serializable { |
| | | @Table(name="sys_user_contract") |
| | | public class SysUserContract extends BaseEntity implements Serializable { |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | |
| | | @ApiModelProperty(value = "公司id") |
| | | private Long companyId; |
| | | |
| | | public void copy(SysContract source){ |
| | | @Column(name = "`remarks`") |
| | | @ApiModelProperty(value = "备注") |
| | | private String remarks; |
| | | |
| | | public void copy(SysUserContract source){ |
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); |
| | | } |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysContractRepository.java |
| | |
| | | */ |
| | | package me.zhengjie.modules.system.repository; |
| | | |
| | | import me.zhengjie.modules.system.domain.SysContract; |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | |
| | |
| | | * @author wcd |
| | | * @date 2023-01-31 |
| | | **/ |
| | | public interface SysContractRepository extends JpaRepository<SysContract, Long>, JpaSpecificationExecutor<SysContract> { |
| | | public interface SysUserContractRepository extends JpaRepository<SysUserContract, Long>, JpaSpecificationExecutor<SysUserContract> { |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/SysContractController.java |
| | |
| | | package me.zhengjie.modules.system.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.system.domain.SysContract; |
| | | import me.zhengjie.modules.system.service.SysContractService; |
| | | import me.zhengjie.modules.system.service.dto.SysContractQueryCriteria; |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import me.zhengjie.modules.system.service.SysUserContractService; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "合同部分管理") |
| | | @RequestMapping("/api/sysContract") |
| | | public class SysContractController { |
| | | public class SysUserContractController { |
| | | |
| | | private final SysContractService sysContractService; |
| | | private final SysUserContractService sysUserContractService; |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('sysContract:list')") |
| | | public void exportSysContract(HttpServletResponse response, SysContractQueryCriteria criteria) throws IOException { |
| | | sysContractService.download(sysContractService.queryAll(criteria), response); |
| | | public void exportSysContract(HttpServletResponse response, SysUserContractQueryCriteria criteria) throws IOException { |
| | | sysUserContractService.download(sysUserContractService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @Log("查询合同部分") |
| | | @ApiOperation("查询合同部分") |
| | | @PreAuthorize("@el.check('sysContract:list')") |
| | | public ResponseEntity<Object> querySysContract(SysContractQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(sysContractService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | public ResponseEntity<Object> querySysContract(SysUserContractQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(sysUserContractService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/all") |
| | | @Log("查询合同部分") |
| | | @ApiOperation("查询合同部分") |
| | | @PreAuthorize("@el.check('sysContract:list')") |
| | | public ResponseEntity<Object> querySysContract(SysContractQueryCriteria criteria){ |
| | | return new ResponseEntity<>(sysContractService.queryAll(criteria),HttpStatus.OK); |
| | | public ResponseEntity<Object> querySysContract(SysUserContractQueryCriteria criteria){ |
| | | return new ResponseEntity<>(sysUserContractService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增合同部分") |
| | | @ApiOperation("新增合同部分") |
| | | @PreAuthorize("@el.check('sysContract:add')") |
| | | public ResponseEntity<Object> createSysContract(@Validated @RequestBody SysContract resources){ |
| | | return new ResponseEntity<>(sysContractService.create(resources),HttpStatus.CREATED); |
| | | public ResponseEntity<Object> createSysContract(@Validated @RequestBody SysUserContract resources){ |
| | | return new ResponseEntity<>(sysUserContractService.create(resources),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改合同部分") |
| | | @ApiOperation("修改合同部分") |
| | | @PreAuthorize("@el.check('sysContract:edit')") |
| | | public ResponseEntity<Object> updateSysContract(@Validated @RequestBody SysContract resources){ |
| | | sysContractService.update(resources); |
| | | public ResponseEntity<Object> updateSysContract(@Validated @RequestBody SysUserContract resources){ |
| | | sysUserContractService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | |
| | | @ApiOperation("删除合同部分") |
| | | @PreAuthorize("@el.check('sysContract:del')") |
| | | public ResponseEntity<Object> deleteSysContract(@RequestBody Long[] ids) { |
| | | sysContractService.deleteAll(ids); |
| | | sysUserContractService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/SysContractService.java |
| | |
| | | */ |
| | | package me.zhengjie.modules.system.service; |
| | | |
| | | import me.zhengjie.modules.system.domain.SysContract; |
| | | import me.zhengjie.modules.system.service.dto.SysContractDto; |
| | | import me.zhengjie.modules.system.service.dto.SysContractQueryCriteria; |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractDto; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | |
| | | * @author wcd |
| | | * @date 2023-01-31 |
| | | **/ |
| | | public interface SysContractService { |
| | | public interface SysUserContractService { |
| | | |
| | | /** |
| | | * 查询数据分页 |
| | |
| | | * @param pageable 分页参数 |
| | | * @return Map<String,Object> |
| | | */ |
| | | Map<String,Object> queryAll(SysContractQueryCriteria criteria, Pageable pageable); |
| | | Map<String,Object> queryAll(SysUserContractQueryCriteria criteria, Pageable pageable); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<SysContractDto> |
| | | */ |
| | | List<SysContractDto> queryAll(SysContractQueryCriteria criteria); |
| | | List<SysUserContractDto> queryAll(SysUserContractQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * @param id ID |
| | | * @return SysContractDto |
| | | */ |
| | | SysContractDto findById(Long id); |
| | | SysUserContractDto findById(Long id); |
| | | |
| | | /** |
| | | * 创建 |
| | | * @param resources / |
| | | * @return SysContractDto |
| | | */ |
| | | SysContractDto create(SysContract resources); |
| | | SysUserContractDto create(SysUserContract resources); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param resources / |
| | | */ |
| | | void update(SysContract resources); |
| | | void update(SysUserContract resources); |
| | | |
| | | /** |
| | | * 多选删除 |
| | |
| | | * @param response / |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<SysContractDto> all, HttpServletResponse response) throws IOException; |
| | | void download(List<SysUserContractDto> all, HttpServletResponse response) throws IOException; |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysContractDto.java |
| | |
| | | * @date 2023-01-31 |
| | | **/ |
| | | @Data |
| | | public class SysContractDto extends BaseDTO implements Serializable { |
| | | public class SysUserContractDto extends BaseDTO implements Serializable { |
| | | |
| | | private Long id; |
| | | |
| | |
| | | |
| | | /** 用户名称 */ |
| | | private String userName; |
| | | |
| | | /** 备注 */ |
| | | private String remarks; |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysContractQueryCriteria.java |
| | |
| | | * @date 2023-01-31 |
| | | **/ |
| | | @Data |
| | | public class SysContractQueryCriteria{ |
| | | public class SysUserContractQueryCriteria { |
| | | |
| | | //用户查询 |
| | | @Query |
| New file |
| | |
| | | /* |
| | | * Copyright 2019-2020 Zheng Jie |
| | | * |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package me.zhengjie.modules.system.service.impl; |
| | | |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import me.zhengjie.modules.system.domain.SystemSetting; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.SystemSettingRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractDto; |
| | | import me.zhengjie.modules.system.service.mapstruct.SysUserContractMapper; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.system.repository.SysUserContractRepository; |
| | | import me.zhengjie.modules.system.service.SysUserContractService; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractQueryCriteria; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.Pageable; |
| | | import me.zhengjie.utils.PageUtil; |
| | | import me.zhengjie.utils.QueryHelp; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.function.Function; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description 服务实现 |
| | | * @author wcd |
| | | * @date 2023-01-31 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class SysUserUserContractServiceImpl implements SysUserContractService { |
| | | |
| | | private final SysUserContractRepository sysUserContractRepository; |
| | | private final SysUserContractMapper sysUserContractMapper; |
| | | private final UserRepository userRepository; |
| | | private final SystemSettingRepository systemSettingRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(SysUserContractQueryCriteria criteria, Pageable pageable){ |
| | | Page<SysUserContract> page = sysUserContractRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); |
| | | //将实体转换为Dto(重写) |
| | | Function<SysUserContract, SysUserContractDto> func = new Function<SysUserContract, SysUserContractDto>(){ |
| | | |
| | | @Override |
| | | public SysUserContractDto apply(SysUserContract attendance) { |
| | | // 将实体类转换成DTO |
| | | SysUserContractDto sysUserContractDto = sysUserContractMapper.toDto(attendance); |
| | | //查询用户信息 |
| | | User user = userRepository.findById(sysUserContractDto.getUserId()).orElseGet(User::new); |
| | | sysUserContractDto.setUserName(user.getNickName()); |
| | | //查询公司信息 |
| | | SystemSetting systemSetting = systemSettingRepository.findById(sysUserContractDto.getCompanyId()).orElseGet(SystemSetting::new); |
| | | sysUserContractDto.setCompName(systemSetting.getLabel()); |
| | | return sysUserContractDto; |
| | | } |
| | | }; |
| | | return PageUtil.toPage(page.map(func)); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysUserContractDto> queryAll(SysUserContractQueryCriteria criteria){ |
| | | return sysUserContractMapper.toDto(sysUserContractRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public SysUserContractDto findById(Long id) { |
| | | SysUserContract sysUserContract = sysUserContractRepository.findById(id).orElseGet(SysUserContract::new); |
| | | ValidationUtil.isNull(sysUserContract.getId(),"SysContract","id",id); |
| | | return sysUserContractMapper.toDto(sysUserContract); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public SysUserContractDto create(SysUserContract resources) { |
| | | return sysUserContractMapper.toDto(sysUserContractRepository.save(resources)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(SysUserContract resources) { |
| | | SysUserContract sysUserContract = sysUserContractRepository.findById(resources.getId()).orElseGet(SysUserContract::new); |
| | | ValidationUtil.isNull( sysUserContract.getId(),"SysContract","id",resources.getId()); |
| | | sysUserContract.copy(resources); |
| | | sysUserContractRepository.save(sysUserContract); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long id : ids) { |
| | | sysUserContractRepository.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<SysUserContractDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (SysUserContractDto sysContract : all) { |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | User user = userRepository.findById(sysContract.getUserId()).orElseGet(User::new); |
| | | SystemSetting systemSetting = systemSettingRepository.findById(sysContract.getCompanyId()).orElseGet(SystemSetting::new); |
| | | map.put("所属员工", user.getNickName()); |
| | | map.put("合同名称", sysContract.getContractName()); |
| | | map.put("合同开始时间", sysContract.getContractStartTime()); |
| | | map.put("合同结束时间", sysContract.getContractEndTime()); |
| | | map.put("公司", systemSetting.getLabel()); |
| | | map.put("创建者", sysContract.getCreateBy()); |
| | | map.put("创建时间", sysContract.getCreateTime()); |
| | | map.put("更新者", sysContract.getUpdateBy()); |
| | | map.put("更新时间", sysContract.getUpdateTime()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/SysContractMapper.java |
| | |
| | | package me.zhengjie.modules.system.service.mapstruct; |
| | | |
| | | import me.zhengjie.base.BaseMapper; |
| | | import me.zhengjie.modules.system.domain.SysContract; |
| | | import me.zhengjie.modules.system.service.dto.SysContractDto; |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractDto; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.ReportingPolicy; |
| | | |
| | |
| | | * @date 2023-01-31 |
| | | **/ |
| | | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) |
| | | public interface SysContractMapper extends BaseMapper<SysContractDto, SysContract> { |
| | | public interface SysUserContractMapper extends BaseMapper<SysUserContractDto, SysUserContract> { |
| | | |
| | | } |
| | |
| | | <div class="dashboard-editor-container"> |
| | | <panel-group :user-info="userInfo" @handleSetLineChartData="handleSetLineChartData" /> |
| | | <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> |
| | | <FullCalendar ref="fullCalendar" :options="calendarOptions" class="eventDeal-wrap" /> |
| | | <FullCalendar ref="fullCalendar" :options="calendarOptions" /> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | |
| | | import moment from 'moment' |
| | | |
| | | const lineChartData = { |
| | | newVisitis: { |
| | | expectedData: [100, 120, 161, 134, 105, 160, 165], |
| | | actualData: [120, 82, 91, 154, 162, 140, 145] |
| | | }, |
| | | messages: { |
| | | expectedData: [200, 192, 120, 144, 160, 130, 140], |
| | | actualData: [180, 160, 151, 106, 145, 150, 130] |
| | | }, |
| | | purchases: { |
| | | expectedData: [80, 100, 121, 104, 105, 90, 100], |
| | | actualData: [120, 90, 100, 138, 142, 130, 130] |
| | | }, |
| | | shoppings: { |
| | | expectedData: [130, 140, 141, 142, 145, 150, 160], |
| | | actualData: [120, 82, 91, 154, 162, 140, 130] |
| | | } |
| | | // newVisitis: { |
| | | // expectedData: [100, 120, 161, 134, 105, 160, 165], |
| | | // actualData: [120, 82, 91, 154, 162, 140, 145] |
| | | // }, |
| | | // messages: { |
| | | // expectedData: [200, 192, 120, 144, 160, 130, 140], |
| | | // actualData: [180, 160, 151, 106, 145, 150, 130] |
| | | // }, |
| | | // purchases: { |
| | | // expectedData: [80, 100, 121, 104, 105, 90, 100], |
| | | // actualData: [120, 90, 100, 138, 142, 130, 130] |
| | | // }, |
| | | // shoppings: { |
| | | // expectedData: [130, 140, 141, 142, 145, 150, 160], |
| | | // actualData: [120, 82, 91, 154, 162, 140, 130] |
| | | // } |
| | | } |
| | | |
| | | export default { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | lineChartData: lineChartData.newVisitis, |
| | | // lineChartData: lineChartData.newVisitis, |
| | | calendarOptions: { |
| | | // 引入的插件 |
| | | plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin], |
| | |
| | | locale: 'zh-ch', |
| | | firstDay: '1', |
| | | weekNumberCalculation: 'ISO', |
| | | eventCOlor: '#3d8eec', |
| | | eventColor: '#3d8eec', |
| | | timeGridEventMinHeight: '20', |
| | | aspectRatio: '1.5', |
| | | displayEventTime: false, |
| | |
| | | // 获取打卡信息 |
| | | getUserCalendarInfo(month) { |
| | | crudUser.getUserCalendarInfo(month).then(res => { |
| | | console.log('res', res) |
| | | this.calendarOptions.events = res.map(function(obj) { |
| | | obj.start = obj.date |
| | | // obj.start = obj.date |
| | | obj.color = obj.isOk ? 'green' : 'red' |
| | | obj.date1 = obj.date |
| | | // obj.date1 = obj.date |
| | | return obj |
| | | }) |
| | | setTimeout(() => { |
| | | console.log(this.calendarOptions.events) |
| | | }, 1000) |
| | | }).catch(() => { |
| | | this.calendarOptions.events = [] |
| | | }) |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style rel="stylesheet/scss" lang="scss" scoped> |
| | | .dashboard-editor-container { |
| | | padding: 32px; |
| | | background-color: rgb(240, 242, 245); |
| | | position: relative; |
| | | // <style rel="stylesheet/scss" lang="scss" scoped> |
| | | // .dashboard-editor-container { |
| | | // padding: 32px; |
| | | // background-color: rgb(240, 242, 245); |
| | | // position: relative; |
| | | |
| | | .github-corner { |
| | | position: absolute; |
| | | top: 0; |
| | | border: 0; |
| | | right: 0; |
| | | } |
| | | // .github-corner { |
| | | // position: absolute; |
| | | // top: 0; |
| | | // border: 0; |
| | | // right: 0; |
| | | // } |
| | | |
| | | .chart-wrapper { |
| | | background: #fff; |
| | | padding: 16px 16px 0; |
| | | margin-bottom: 32px; |
| | | } |
| | | } |
| | | // .chart-wrapper { |
| | | // background: #fff; |
| | | // padding: 16px 16px 0; |
| | | // margin-bottom: 32px; |
| | | // } |
| | | // } |
| | | |
| | | @media (max-width:1024px) { |
| | | .chart-wrapper { |
| | | padding: 8px; |
| | | } |
| | | } |
| | | </style> |
| | | // @media (max-width:1024px) { |
| | | // .chart-wrapper { |
| | | // padding: 8px; |
| | | // } |
| | | // } |
| | | // </style> |
| | |
| | | <el-form-item label="开始时间" prop="contractStartTime"> |
| | | <el-date-picker |
| | | v-model="form.contractStartTime" |
| | | type="datetime" |
| | | type="date" |
| | | placeholder="选择日期时间" |
| | | style="width: 370px;" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | align="right" |
| | | :picker-options="{ |
| | | disabledDate(time) { |
| | |
| | | <el-form-item label="结束时间" prop="contractEndTime"> |
| | | <el-date-picker |
| | | v-model="form.contractEndTime" |
| | | type="datetime" |
| | | type="date" |
| | | placeholder="选择日期时间" |
| | | style="width: 370px;" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | align="right" |
| | | :picker-options="{ |
| | | disabledDate(time) { |
| | |
| | | }" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="公司" prop="companyId"> |
| | | <el-form-item label="所属公司" prop="companyId"> |
| | | <el-select v-model="form.companyId" style="width: 370px" clearable> |
| | | <el-option v-for="item in companyList" :key="item.id" :label="item.label" :value="item.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remarks"> |
| | | <el-input v-model="form.remarks" type="textarea" rows="3" style="width: 370px;" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | <el-tag>{{ scope.row.userName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="contractName" label="合同名称" show-overflow-tooltip> |
| | | <el-table-column prop="contractName" label="合同名称" show-overflow-tooltip /> |
| | | <el-table-column prop="contractStartTime" label="合同开始时间" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.contractName }}</el-tag> |
| | | {{ crud.toDate(scope.row.contractStartTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="contractStartTime" label="合同开始时间" show-overflow-tooltip /> |
| | | <el-table-column prop="contractEndTime" label="合同结束时间" show-overflow-tooltip /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="companyId" label="公司"> |
| | | <el-table-column prop="contractEndTime" label="合同结束时间" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toDate(scope.row.contractEndTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="companyId" label="所属公司"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.compName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" show-overflow-tooltip /> |
| | | <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip /> |
| | | <el-table-column v-if="checkPer(['admin','sysContract:edit','sysContract:del'])" label="操作" width="150px" align="center"> |
| | | <template slot-scope="scope"> |
| | |
| | | import crudSystemSetting from '@/api/system/systemSetting' |
| | | import crudUser from '@/api/system/user' |
| | | |
| | | const defaultForm = { id: null, userId: null, contractName: null, contractStartTime: null, contractEndTime: null, companyId: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, userId: null, contractName: null, contractStartTime: null, contractEndTime: null, companyId: null, createBy: null, createTime: null, updateBy: null, updateTime: null, remarks: null } |
| | | export default { |
| | | name: 'SysContract', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |