瀏覽代碼

修改用户权限,登录去除注册,路由权限。最大人数和截止时间限制。

seyason 3 年之前
父節點
當前提交
d9ecf48ccf
共有 23 個文件被更改,包括 399 次插入494 次删除
  1. 11 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectBasecostSettingController.java
  2. 27 27
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectDocumentController.java
  3. 1 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java
  4. 14 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  5. 13 9
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  6. 131 131
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/OpenOfficeService.java
  7. 17 16
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/SmsUtil.java
  8. 0 90
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-dev.yml
  9. 0 102
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-prod.yml
  10. 18 44
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml
  11. 10 10
      fhKeeper/formulahousekeeper/timesheet/config/index.js
  12. 75 6
      fhKeeper/formulahousekeeper/timesheet/package-lock.json
  13. 14 15
      fhKeeper/formulahousekeeper/timesheet/src/main.js
  14. 11 11
      fhKeeper/formulahousekeeper/timesheet/src/routes.js
  15. 4 4
      fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue
  16. 28 0
      fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue
  17. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue
  18. 4 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/earning.vue
  19. 4 2
      fhKeeper/formulahousekeeper/timesheet/src/views/project/fileCenter.vue
  20. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue
  21. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue
  22. 13 10
      fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue
  23. 1 1
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 11 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectBasecostSettingController.java

@@ -82,6 +82,17 @@ public class ProjectBasecostSettingController {
 
         Integer companyId = userMapper.selectById(request.getHeader("TOKEN")).getCompanyId();
         List<ProjectBasecostSetting> list = projectBasecostSettingMapper.selectList(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", companyId));
+        if (list.size() == 0) {
+            //生成项目的成本基线默认条目
+            String[] array = com.management.platform.util.Constant.DEFAULT_BASE_COST_ITEMS;
+            for (String baseItem : array) {
+                ProjectBasecostSetting setting = new ProjectBasecostSetting();
+                setting.setName(baseItem);
+                setting.setCompanyId(companyId);
+                projectBasecostSettingMapper.insert(setting);
+            }
+            list = projectBasecostSettingMapper.selectList(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", companyId));
+        }
         msg.data = list;
 
         return msg;

+ 27 - 27
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectDocumentController.java

@@ -15,7 +15,7 @@ import com.management.platform.service.ProjectDocumentService;
 import com.management.platform.util.DocumentTypeUtil;
 import com.management.platform.util.FileUtil;
 import com.management.platform.util.HttpRespMsg;
-import com.management.platform.util.OpenOfficeService;
+//import com.management.platform.util.OpenOfficeService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -82,9 +82,9 @@ public class ProjectDocumentController {
         HttpRespMsg msg = new HttpRespMsg();
         User user = (User) userMapper.selectById(request.getHeader("Token"));
 
-        OpenOfficeService openOfficeService = new OpenOfficeService();
+//        OpenOfficeService openOfficeService = new OpenOfficeService();
 //        List<Part> partLists = partMapper.selectList(new QueryWrapper<Part>().eq("mould_id", userVO.getMouldId()));
-        openOfficeService.start();
+//        openOfficeService.start();
         ExecutorService fixedThreadPool = Executors.newFixedThreadPool(3);
         for (MultipartFile file : files) {
             ProjectDocument record = new ProjectDocument();
@@ -129,20 +129,20 @@ public class ProjectDocumentController {
 //                        record.setUrl(url);
                         projectDocumentMapper.insert(record);
                         String path = uploadPath;
-                        if (OpenOfficeService.canTransferToPdf(suffix)) {
-                            //上传完,需要生成pdf
-                            String dFile1 = path + UUID.randomUUID().toString().replaceAll("-", "") + ".pdf";
-                            File newFile = new File(dFile1);
-                            if (!newFile.exists()) {
-                                openOfficeService.office2PDF(path + fileName, dFile1);
-                                PdfFile pdfFile = new PdfFile();
-                                pdfFile.setPdfUrl(pathPrefix + dFile1.substring(path.length()));
-                                pdfFile.setFileId(record.getId());
-                                pdfFile.setType(1);
-                                pdfFile.setSourceFileUrl(record.getUrl());
-                                pdfFileMapper.insert(pdfFile);
-                            }
-                        }
+//                        if (OpenOfficeService.canTransferToPdf(suffix)) {
+//                            //上传完,需要生成pdf
+//                            String dFile1 = path + UUID.randomUUID().toString().replaceAll("-", "") + ".pdf";
+//                            File newFile = new File(dFile1);
+//                            if (!newFile.exists()) {
+//                                openOfficeService.office2PDF(path + fileName, dFile1);
+//                                PdfFile pdfFile = new PdfFile();
+//                                pdfFile.setPdfUrl(pathPrefix + dFile1.substring(path.length()));
+//                                pdfFile.setFileId(record.getId());
+//                                pdfFile.setType(1);
+//                                pdfFile.setSourceFileUrl(record.getUrl());
+//                                pdfFileMapper.insert(pdfFile);
+//                            }
+//                        }
 
                         //生成原文件名称与服务器文件名称对应
                         msg.data = record;
@@ -181,17 +181,17 @@ public class ProjectDocumentController {
             map.put("pdfFileName", uploadPath + destFile.getName());
         }else {
             //文件不存在,转化后显示
-            OpenOfficeService service = new OpenOfficeService();
-            service.start();
+//            OpenOfficeService service = new OpenOfficeService();
+//            service.start();
             File inputFile = new File(dir, inputFilePath);
-            Integer state = service.office2PDF(inputFile.getAbsolutePath(),destFile.getAbsolutePath());
-            if(state == 0){
-                //转换成功
-                map.put("pdfFileName", uploadPath + destFile.getName());
-            }else {
-                //转换失败
-            }
-            service.shutdown();
+//            Integer state = service.office2PDF(inputFile.getAbsolutePath(),destFile.getAbsolutePath());
+//            if(state == 0){
+//                //转换成功
+//                map.put("pdfFileName", uploadPath + destFile.getName());
+//            }else {
+//                //转换失败
+//            }
+//            service.shutdown();
         }
         msg.data = map;
         return msg;

+ 1 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserController.java

@@ -107,12 +107,7 @@ public class UserController {
      * name 姓名
      * phone 电话号码
      */
-    @RequestMapping("/insertCompany")
-    public HttpRespMsg insertCompany(
-            @RequestParam String companyName, @RequestParam String name, @RequestParam String phone,
-            String vcode, String password) {
-        return userService.insertCompany(companyName, name, phone, vcode, password);
-    }
+    //私有部署,禁用公司注册
 
     /**
      * 新增或修改用户

+ 14 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -90,11 +90,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
     public HttpRespMsg getProjectList(HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         try {
-            //通过公司id获取该公司所有的项目列表
-//            Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
-//            httpRespMsg.data = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId));
-            //现在是获取本人相关的项目列表
-            httpRespMsg.data = projectMapper.getParticipatedProject(request.getHeader("Token"));
+            User user = userMapper.selectById(request.getHeader("Token"));
+            if (user.getRole() == 0) {
+                //普通员工只能看本人相关的项目列表
+                httpRespMsg.data = projectMapper.getParticipatedProject(user.getId());
+            } else {
+                //其他的管理员,都可以看全部的
+                httpRespMsg.data = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", user.getCompanyId()));
+            }
         } catch (NullPointerException e) {
             httpRespMsg.setError("验证失败");
             return httpRespMsg;
@@ -322,7 +325,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                         record.setCostData(projectBaseCostData);
                         record.setCostTotal(p.getBudget());
                         record.setProfit(p.getContractAmount() - p.getBudget());
-                        record.setProfitPercent(100.0*(p.getContractAmount() - p.getBudget())/p.getContractAmount());
+                        if (p.getContractAmount() == 0) {
+                            record.setProfitPercent(0.0);
+                        } else {
+                            record.setProfitPercent(100.0*(p.getContractAmount() - p.getBudget())/p.getContractAmount());
+                        }
+
                         earningSnapshotMapper.insert(record);
                     }
                 }

+ 13 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -58,7 +58,10 @@ import java.util.*;
  */
 @Service
 public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
-
+    //上海久事的有效期
+    private final LocalDateTime EXP_DATE_JIUSHI = LocalDateTime.parse("2022-07-15 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+    //上海久事人数
+    private int MAX_MEMB_COUNT = 20;
     @Value(value = "${upload.path}")
     private String path;
     @Value("${wx.template_report_fill}")
@@ -114,6 +117,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         } else if (MD5Util.getPassword(password).equals(userList.get(0).getPassword())) {
             //查看该公司非会员公司,只能允许试用三天,超时不可登录
             Company company = companyMapper.selectOne(new QueryWrapper<Company>().eq("id", userList.get(0).getCompanyId()));
+            if (company.getExpirationDate().compareTo(EXP_DATE_JIUSHI) != 0) {
+                company.setExpirationDate(EXP_DATE_JIUSHI);
+                companyMapper.updateById(company);
+            }
             //公司未办理会员
             if (null != company.getExpirationDate()) {
                 if (0 == company.getSetMeal()) {
@@ -341,7 +348,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             timeType.setCompanyId(company.getId());
             timeTypeMapper.insert(timeType);
             if (userMapper.selectCount(new QueryWrapper<User>().eq("company_id", company.getId())) >=
-                    (companyMapper.selectById(company.getId()).getStaffCountMax())) {
+                    MAX_MEMB_COUNT) {
                 httpRespMsg.setError("公司人员已达上限");
                 return httpRespMsg;
             }
@@ -385,9 +392,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             BigDecimal monthCostValue = (monthCost == null ? BigDecimal.valueOf(0) : BigDecimal.valueOf(monthCost));
             if (targetId == null) {
                 //新增
-                if (creator.getRole() == 2 && role != 0) {
-                    httpRespMsg.setError("管理员只能新增普通员工");
-                } else if (role == 3) {
+                if (role == 1) {
                     httpRespMsg.setError("不可新增负责人");
                 } else {
                     //电话号码列 检测重名
@@ -397,7 +402,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                         //只计算活跃的用户
                         if (userMapper.selectCount(new QueryWrapper<User>()
                                 .eq("company_id", creator.getCompanyId()).eq("is_active", 1)) >=
-                                (companyMapper.selectById(creator.getCompanyId()).getStaffCountMax())) {
+                                MAX_MEMB_COUNT) {
                             httpRespMsg.setError("公司人员已达上限");
                         } else {
                             Long id = SnowFlake.nextId();
@@ -529,7 +534,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
         //检查人数是否已达上限
         Company company = companyMapper.selectById(companyId);
-        int maxCnt = company.getStaffCountMax();
+        int maxCnt = MAX_MEMB_COUNT;
         long cnt = userMapper.selectCount(new QueryWrapper<User>().eq("company_id", companyId).eq("is_active", 1));
         if (cnt >= maxCnt) {
             httpRespMsg.setError("人数已达上限,无法导入.请联系客服提高人数上限。");
@@ -718,7 +723,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         User user = userMapper.selectById(token);
         if (isActive == 1 && userMapper.selectCount(new QueryWrapper<User>()
                 .eq("company_id", user.getCompanyId()).eq("is_active", 1)) >=
-                (companyMapper.selectById(user.getCompanyId()).getStaffCountMax())) {
+                MAX_MEMB_COUNT) {
             msg.setError("公司人员已达上限,无法启用");
         } else {
             User setUser = new User();
@@ -1096,7 +1101,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         return msg;
     }
 
-
     public boolean push(User user, String date) {
         //1,配置
         WxMpInMemoryConfigStorage wxStorage = new WxMpInMemoryConfigStorage();

+ 131 - 131
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/OpenOfficeService.java

@@ -1,131 +1,131 @@
-package com.management.platform.util;
-
-import lombok.extern.slf4j.Slf4j;
-import org.artofsolving.jodconverter.OfficeDocumentConverter;
-import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
-import org.artofsolving.jodconverter.office.OfficeManager;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Random;
-import java.util.regex.Pattern;
-
-@Slf4j
-public class OpenOfficeService {
-	//64位windows系统默认安装路径
-	public static String OpenOffice_HOME_64 = "C://Program Files (x86)/OpenOffice 4/";
-	//32位windows系统默认安装路径
-	public static String OpenOffice_HOME_32 = "C://Program Files/OpenOffice 4/";
-	public static String OpenOffice_HOME_UNIX = "/opt/openoffice4/";
-	public static int PORT = 12312;
-	private static OfficeManager officeManager;
-
-	public static boolean canTransferToPdf(String suffix) {
-		if (".doc".equals(suffix) || ".docx".equals(suffix)
-				|| ".xls".equals(suffix) || ".xlsx".equals(suffix)
-				|| ".ppt".equals(suffix) || ".pptx".equals(suffix)
-				|| ".jpg".equals(suffix) || ".png".equals(suffix)
-				|| ".bmp".equals(suffix) || ".jpeg".equals(suffix)
-				|| ".txt".equals(suffix)) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-	/**
-	 * 启动openoffice服务
-	 */
-	public void start() {
-		try {
-			log.info("===Openoffice实例启动中...");
-			DefaultOfficeManagerConfiguration config = new DefaultOfficeManagerConfiguration();
-			String officeHome = getOfficeHome();
-			log.info("officeHome====="+officeHome);
-			config.setOfficeHome(officeHome);
-//	        int randomPort = new Random().nextInt(1000);
-//	        randomPort += 8000;
-			config.setPortNumber(PORT);
-			officeManager = config.buildOfficeManager();
-			officeManager.start();
-			log.info("Openoffice实例启动成功!");
-		} catch (Exception e) {
-			e.printStackTrace();
-			log.info("OpenOffice启动失败:"+e.getMessage());
-		}
-	}
-
-	public static String getOfficeHome() {
-		String osName = System.getProperty("os.name");
-		if (Pattern.matches("Linux.*", osName)) {
-			return OpenOffice_HOME_UNIX;
-		} else if (Pattern.matches("Windows.*", osName)) {
-			String arch = System.getProperty("os.arch");
-			boolean is64bit = (System.getenv("ProgramFiles(x86)") != null);
-			if (is64bit) {
-				return OpenOffice_HOME_64;
-			} else {
-				return OpenOffice_HOME_32;
-			}
-		} else if (Pattern.matches("Mac.*", osName)) {
-			return "/Application/OpenOffice.org.app/Contents";
-		}
-		return null;
-	}
-
-	/**
-	 * 文档转换
-	 * @param inputFilePath
-	 * @param destFile
-	 * @return 0-转换成,-1转换失败
-	 */
-	public  int office2PDF(String inputFilePath, String destFile) {
-		//txt后缀需要改成odt再进行转换
-		if (inputFilePath.endsWith(".txt")) {
-			String tempFilePath = inputFilePath.replaceAll(".txt", ".odt");
-			try {
-				org.apache.commons.io.FileUtils.copyFile(new File(inputFilePath), new File(tempFilePath));
-			} catch (IOException e) {
-				e.printStackTrace();
-			}
-			inputFilePath = tempFilePath;
-		}
-		OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
-		File outputFile = new File(destFile);
-		if (!outputFile.getParentFile().exists()) {
-			outputFile.getParentFile().mkdirs();
-		}
-		File inputFile = new File(inputFilePath);
-		if (inputFile.exists()) {// 找不到源文件, 则返回
-			converter.convert(inputFile, outputFile);
-		} else {
-			return -1;
-		}
-		return 0;
-	}
-
-	/**
-	 * 停止服务
-	 */
-	public void shutdown() {
-		if (officeManager != null) {
-			officeManager.stop();
-			System.out.println("Openoffice实例停止!");
-		}
-	}
-
-
-	public static void main(String[] args) {
-		OpenOfficeService service = new OpenOfficeService();
-		String sFile = "D:\\1.pdf";
-		String dFile = "D:\\wttxls111000000000000000.pdf";
-		service.start();
-		File testFile = new File(dFile);
-		if(!testFile .exists()){
-			System.out.println("测试文件不存在,开始转换......");
-			service.office2PDF(sFile,dFile);
-		}else{
-			System.out.println("测试文件已存在");
-		}
-		service.shutdown();
-	}
-}
+//package com.management.platform.util;
+//
+//import lombok.extern.slf4j.Slf4j;
+//import org.artofsolving.jodconverter.OfficeDocumentConverter;
+//import org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration;
+//import org.artofsolving.jodconverter.office.OfficeManager;
+//
+//import java.io.File;
+//import java.io.IOException;
+//import java.util.Random;
+//import java.util.regex.Pattern;
+//
+//@Slf4j
+//public class OpenOfficeService {
+//	//64位windows系统默认安装路径
+//	public static String OpenOffice_HOME_64 = "C://Program Files (x86)/OpenOffice 4/";
+//	//32位windows系统默认安装路径
+//	public static String OpenOffice_HOME_32 = "C://Program Files/OpenOffice 4/";
+//	public static String OpenOffice_HOME_UNIX = "/opt/openoffice4/";
+//	public static int PORT = 12312;
+//	private static OfficeManager officeManager;
+//
+//	public static boolean canTransferToPdf(String suffix) {
+//		if (".doc".equals(suffix) || ".docx".equals(suffix)
+//		|| ".xls".equals(suffix) || ".xlsx".equals(suffix)
+//		|| ".ppt".equals(suffix) || ".pptx".equals(suffix)
+//		|| ".jpg".equals(suffix) || ".png".equals(suffix)
+//		|| ".bmp".equals(suffix) || ".jpeg".equals(suffix)
+//		|| ".txt".equals(suffix)) {
+//			return true;
+//		} else {
+//			return false;
+//		}
+//	}
+//	/**
+//	 * 启动openoffice服务
+//	 */
+//	public void start() {
+//		try {
+//			log.info("===Openoffice实例启动中...");
+//			DefaultOfficeManagerConfiguration config = new DefaultOfficeManagerConfiguration();
+//	        String officeHome = getOfficeHome();
+//			log.info("officeHome====="+officeHome);
+//	        config.setOfficeHome(officeHome);
+////	        int randomPort = new Random().nextInt(1000);
+////	        randomPort += 8000;
+//	        config.setPortNumber(PORT);
+//	        officeManager = config.buildOfficeManager();
+//	        officeManager.start();
+//			log.info("Openoffice实例启动成功!");
+//		} catch (Exception e) {
+//			e.printStackTrace();
+//			log.info("OpenOffice启动失败:"+e.getMessage());
+//		}
+//	}
+//
+//	public static String getOfficeHome() {
+//        String osName = System.getProperty("os.name");
+//        if (Pattern.matches("Linux.*", osName)) {
+//            return OpenOffice_HOME_UNIX;
+//        } else if (Pattern.matches("Windows.*", osName)) {
+//        	String arch = System.getProperty("os.arch");
+//        	boolean is64bit = (System.getenv("ProgramFiles(x86)") != null);
+//        	if (is64bit) {
+//        		return OpenOffice_HOME_64;
+//        	} else {
+//        		return OpenOffice_HOME_32;
+//        	}
+//        } else if (Pattern.matches("Mac.*", osName)) {
+//            return "/Application/OpenOffice.org.app/Contents";
+//        }
+//        return null;
+//    }
+//
+//	/**
+//	 * 文档转换
+//	 * @param inputFilePath
+//	 * @param destFile
+//	 * @return 0-转换成,-1转换失败
+//	 */
+//	public  int office2PDF(String inputFilePath, String destFile) {
+//		//txt后缀需要改成odt再进行转换
+//		if (inputFilePath.endsWith(".txt")) {
+//			String tempFilePath = inputFilePath.replaceAll(".txt", ".odt");
+//			try {
+//				org.apache.commons.io.FileUtils.copyFile(new File(inputFilePath), new File(tempFilePath));
+//			} catch (IOException e) {
+//				e.printStackTrace();
+//			}
+//			inputFilePath = tempFilePath;
+//		}
+//		OfficeDocumentConverter converter = new OfficeDocumentConverter(officeManager);
+//		File outputFile = new File(destFile);
+//		if (!outputFile.getParentFile().exists()) {
+//			outputFile.getParentFile().mkdirs();
+//		}
+//        File inputFile = new File(inputFilePath);
+//        if (inputFile.exists()) {// 找不到源文件, 则返回
+//            converter.convert(inputFile, outputFile);
+//        } else {
+//        	return -1;
+//        }
+//        return 0;
+//	}
+//
+//	/**
+//	 * 停止服务
+//	 */
+//	public void shutdown() {
+//		if (officeManager != null) {
+//			officeManager.stop();
+//			System.out.println("Openoffice实例停止!");
+//		}
+//	}
+//
+//
+//	public static void main(String[] args) {
+//		OpenOfficeService service = new OpenOfficeService();
+//		String sFile = "D:\\1.pdf";
+//		String dFile = "D:\\wttxls111000000000000000.pdf";
+//		service.start();
+//		File testFile = new File(dFile);
+//		if(!testFile .exists()){
+//			System.out.println("测试文件不存在,开始转换......");
+//			service.office2PDF(sFile,dFile);
+//		}else{
+//			System.out.println("测试文件已存在");
+//		}
+//		service.shutdown();
+//	}
+//}

+ 17 - 16
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/SmsUtil.java

@@ -28,22 +28,23 @@ public class SmsUtil {
     }
 
     public static SendSmsResponse sendSms(String mobile, String code) {
-        com.aliyun.dysmsapi20170525.Client client = null;
-        try {
-            client = SmsUtil.createClient(accessKeyId, accessKeySecret);
-            System.out.println("发送短信");
-            SendSmsRequest sendSmsRequest = new SendSmsRequest()
-                    .setPhoneNumbers(mobile)
-                    .setSignName("火石闪信")
-                    .setTemplateCode("SMS_218575084")
-                    .setTemplateParam("{\"code\":\""+code+"\"}");
-            // 复制代码运行请自行打印 API 的返回值
-            SendSmsResponse sendSmsResponse = client.sendSms(sendSmsRequest);
-            System.out.println(sendSmsResponse.getBody().getCode()+":"+sendSmsResponse.getBody().message);
-            return sendSmsResponse;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
+        //私有部署修改,屏蔽短信
+//        com.aliyun.dysmsapi20170525.Client client = null;
+//        try {
+//            client = SmsUtil.createClient(accessKeyId, accessKeySecret);
+//            System.out.println("发送短信");
+//            SendSmsRequest sendSmsRequest = new SendSmsRequest()
+//                    .setPhoneNumbers(mobile)
+//                    .setSignName("火石闪信")
+//                    .setTemplateCode("SMS_218575084")
+//                    .setTemplateParam("{\"code\":\""+code+"\"}");
+//            // 复制代码运行请自行打印 API 的返回值
+//            SendSmsResponse sendSmsResponse = client.sendSms(sendSmsRequest);
+//            System.out.println(sendSmsResponse.getBody().getCode()+":"+sendSmsResponse.getBody().message);
+//            return sendSmsResponse;
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
         return null;
     }
 

+ 0 - 90
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-dev.yml

@@ -1,90 +0,0 @@
-server:
-  port: 10010
-  tomcat:
-    uri-encoding: utf-8
-    max-http-form-post-size: -1
-    connection-timeout: 18000000s
-spring:
-  servlet:
-    multipart:
-      # 配置上传文件的大小设置
-      # Single file max size  即单个文件大小
-      max-file-size: 10000MB
-      max-request-size: 10000MB
-  datasource:
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://118.190.47.230:3306/man2?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-    username: root
-    password: p011430seya1026
-    hikari:
-      maximum-pool-size: 10
-      minimum-idle: 3
-      max-lifetime: 30000
-      connection-test-query: SELECT 1
-    #######redis配置######
-    # redis
-    redis:
-      host: 118.190.47.230
-      port: 6379
-      timeout: 3
-      # password:
-      pool:
-        minIdle: 1
-        maxIdle: 10
-        maxWait: 3
-        maxActive: 8
-    ####全局配置时间返回格式#####
-  jackson:
-    #参数意义:
-    #JsonInclude.Include.ALWAYS       默认
-    #JsonInclude.Include.NON_DEFAULT   属性为默认值不序列化
-    #JsonInclude.Include.NON_EMPTY     属性为 空(””) 或者为 NULL 都不序列化
-    #JsonInclude.Include.NON_NULL      属性为NULL  不序列化
-    default-property-inclusion: ALWAYS
-    time-zone: GMT+8
-    date-format: yyyy-MM-dd HH:mm:ss
-
-##########日志配置
-logging:
-  level:
-    root: info
-    org.mybatis: debug
-    java.sql: debug
-    org.springframework.web: trace
-    #打印sql语句
-    com.management.platform.mapper: debug
-  path: E:/
-##########
-mybatis-plus:
-  #  mapper-locations: classpath:mapper/*/*.xml
-  #  #实体扫描,多个package用逗号或者分号分隔
-  #  typeAliasesPackage: com.hssx.cloudmodel
-  global-config:
-    #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-    id-type: 0
-    #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-    field-strategy: 2
-    db-column-underline: true
-    refresh-mapper:
-    #################插入和更新非null判断
-    db-config:
-      insert-strategy: not_null
-      update-strategy: not_null
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
-######mybstis配置#######
-mybatis:
-  type-aliases-package: com.management.platform.entity
-  mapper-locations: mappers/*Mapper.xml
-#####配置图片上传路径####
-upload:
-  path: E:/staticproject/timesheet/upload/
-picrecongnize:
-  browser: E:/picrecongnize/browser/
-  develop: E:/picrecongnize/develop/
-  im: E:/picrecongnize/im/
-  design: E:/picrecongnize/design/
-
-
-

+ 0 - 102
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application-prod.yml

@@ -1,102 +0,0 @@
-server:
-  port: 10010
-  tomcat:
-    uri-encoding: utf-8
-    max-http-form-post-size: -1
-    connection-timeout: 18000000s
-spring:
-  servlet:
-    multipart:
-      # 配置上传文件的大小设置
-      # Single file max size  即单个文件大小
-      max-file-size: 10000MB
-      max-request-size: 10000MB
-  datasource:
-    driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://47.100.37.243:7644/man_hour_manager?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-    username: root
-    password: Ziyu20141026!@
-    hikari:
-      maximum-pool-size: 10
-      minimum-idle: 3
-      max-lifetime: 30000
-      connection-test-query: SELECT 1
-    #######redis配置######
-    # redis
-    redis:
-      host: 127.0.0.1
-      port: 6379
-      timeout: 3
-      # password:
-      pool:
-        minIdle: 1
-        maxIdle: 10
-        maxWait: 3
-        maxActive: 8
-    ####全局配置时间返回格式#####
-  jackson:
-    #参数意义:
-    #JsonInclude.Include.ALWAYS       默认
-    #JsonInclude.Include.NON_DEFAULT   属性为默认值不序列化
-    #JsonInclude.Include.NON_EMPTY     属性为 空(””) 或者为 NULL 都不序列化
-    #JsonInclude.Include.NON_NULL      属性为NULL  不序列化
-    default-property-inclusion: ALWAYS
-    time-zone: GMT+8
-    date-format: yyyy-MM-dd HH:mm:ss
-
-##########日志配置
-logging:
-  level:
-    root: info
-    org.mybatis: info
-    java.sql: info
-    org.springframework.web: trace
-    #打印sql语句
-    com.management.platform.mapper: info
-  path: /log/
-  file: worktime.log
-##########
-mybatis-plus:
-  #  mapper-locations: classpath:mapper/*/*.xml
-  #  #实体扫描,多个package用逗号或者分号分隔
-  #  typeAliasesPackage: com.hssx.cloudmodel
-  global-config:
-    #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-    id-type: 0
-    #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-    field-strategy: 2
-    db-column-underline: true
-    refresh-mapper:
-    #################插入和更新非null判断
-    db-config:
-      insert-strategy: not_null
-      update-strategy: not_null
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
-######mybstis配置#######
-mybatis:
-  type-aliases-package: com.management.platform.entity
-  mapper-locations: mappers/*Mapper.xml
-#####配置图片上传路径####
-upload:
-  path: /www/staticproject/timesheet/upload/
-
-
-
-
-
-##actuator健康检查配置
-management:
-  security:
-    enabled:false:
-  server:
-    port: 10011
-  #  endpoints:
-  #    web:
-  #      exposure:
-  #        include: "*"
-
-  health:
-    redis:
-      enabled: false

+ 18 - 44
fhKeeper/formulahousekeeper/management-platform/src/main/resources/application.yml

@@ -9,14 +9,14 @@ spring:
     multipart:
       # 配置上传文件的大小设置
       # Single file max size  即单个文件大小
-      max-file-size: 10000MB
-      max-request-size: 10000MB
+      max-file-size: 1024MB
+      max-request-size: 1024MB
       location: C:/upload/
   datasource:
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://47.100.37.243:7644/man_dev?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-    username: root
-    password: Ziyu20141026!@
+    url:
+    username:
+    password:
     hikari:
       maximum-pool-size: 10
       minimum-idle: 3
@@ -49,48 +49,22 @@ spring:
 logging:
   level:
     root: info
-    org.mybatis: debug
-    java.sql: debug
+    org.mybatis: info
+    java.sql: info
     org.springframework.web: trace
     #打印sql语句
     com.management.platform.mapper: debug
   path: C:/
-##########
-mybatis-plus:
-#  mapper-locations: classpath:mapper/*/*.xml
-#  #实体扫描,多个package用逗号或者分号分隔
-#  typeAliasesPackage: com.hssx.cloudmodel
-  global-config:
-    #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
-    id-type: 0
-    #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
-    field-strategy: 2
-    db-column-underline: true
-    refresh-mapper:
-#################插入和更新非null判断
-    db-config:
-      insert-strategy: not_null
-      update-strategy: not_null
-  configuration:
-    map-underscore-to-camel-case: true
-    cache-enabled: false
-######mybstis配置#######
-mybatis:
-  type-aliases-package: com.management.platform.entity
-  mapper-locations: mappers/*Mapper.xml
+
 #####配置图片上传路径####
 upload:
   path: C:/upload/
-picrecongnize:
-  browser: C:/picrecongnize/browser/
-  develop: C:/picrecongnize/develop/
-  im: C:/picrecongnize/im/
-  design: C:/picrecongnize/design/
-# 智能工时管家公众号参数
+
+# 公众号参数
 wx:
-  template_report_fill: lhwkaW9BKwCvMtCuoAxLw4lZoGgMaucL0Ap0Vz-5KOY
-  app_id: wx749c84daac654e1e
-  app_secret: aacbd046ec1c790836f4f684c96fe585
+  template_report_fill:
+  app_id:
+  app_secret:
 ##actuator健康检查配置
 management:
   security:
@@ -116,12 +90,12 @@ referer:
 excludeUrls: /wxcorp/*,/wxcorp/*/*,/dingding/*,/error
 
 #企业微信相关参数
-suitId: ww4e237fd6abb635af
-suitSecret: 1ApL6LIB4Z0v7wBrKTUNmJrerRWV3gEQWBlYOm8Kijw
+suitId:
+suitSecret:
 #平台作为服务商的参数
-corpId: wwf11426cf618e1703
-token: Mhi7ehNX61UN4MB7PHnC
-encodingAesKey: PHVMkME1XMrImmGJZ4OZJxSysI7hFEhtDDUQrlHAfIS
+corpId:
+token:
+encodingAesKey:
 
 
 

+ 10 - 10
fhKeeper/formulahousekeeper/timesheet/config/index.js

@@ -1,15 +1,15 @@
 var path = require('path')
 
-var ip = '192.168.2.3'
-// var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
-// for (var i in ifaces) {
-//     for (var j in ifaces[i]) {
-//         var val = ifaces[i][j]
-//         if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
-//             ip = val.address
-//         }
-//     }
-// }
+// var ip = '192.168.2.3'
+var os = require('os'), ip = '', ifaces = os.networkInterfaces() // 获取本机ip
+for (var i in ifaces) {
+    for (var j in ifaces[i]) {
+        var val = ifaces[i][j]
+        if (val.family === 'IPv4' && val.address !== '127.0.0.1') {
+            ip = val.address
+        }
+    }
+}
 
 module.exports = {
   build: {

+ 75 - 6
fhKeeper/formulahousekeeper/timesheet/package-lock.json

@@ -2784,6 +2784,11 @@
       "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
       "dev": true
     },
+    "dayjs": {
+      "version": "1.10.6",
+      "resolved": "https://registry.nlark.com/dayjs/download/dayjs-1.10.6.tgz",
+      "integrity": "sha1-KIsqqC8thBimydTfWJjAc3rQKmM="
+    },
     "de-indent": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",
@@ -2813,8 +2818,7 @@
     "deep-equal": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
-      "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=",
-      "dev": true
+      "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU="
     },
     "deepmerge": {
       "version": "1.5.2",
@@ -2939,6 +2943,14 @@
         "randombytes": "^2.0.0"
       }
     },
+    "dingtalk-jsapi": {
+      "version": "2.13.50",
+      "resolved": "https://registry.nlark.com/dingtalk-jsapi/download/dingtalk-jsapi-2.13.50.tgz",
+      "integrity": "sha1-pMn5Wxfzt9iGodg1uJEesPjwCr4=",
+      "requires": {
+        "promise-polyfill": "^7.1.0"
+      }
+    },
     "dir-glob": {
       "version": "2.2.2",
       "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.2.2.tgz",
@@ -3289,8 +3301,7 @@
     "extend": {
       "version": "3.0.2",
       "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz",
-      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=",
-      "dev": true
+      "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo="
     },
     "extend-shallow": {
       "version": "3.0.2",
@@ -3388,6 +3399,11 @@
       "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=",
       "dev": true
     },
+    "fast-diff": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npm.taobao.org/fast-diff/download/fast-diff-1.1.2.tgz",
+      "integrity": "sha1-S2LEK44D3j+EhGC2OQeZIGldAVQ="
+    },
     "fast-json-stable-stringify": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
@@ -5925,8 +5941,7 @@
     "object-assign": {
       "version": "4.1.1",
       "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
-      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
-      "dev": true
+      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
     },
     "object-copy": {
       "version": "0.1.0",
@@ -6196,6 +6211,11 @@
         "no-case": "^2.2.0"
       }
     },
+    "parchment": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npm.taobao.org/parchment/download/parchment-1.1.4.tgz",
+      "integrity": "sha1-rt7Xq5OP6SHUw0vDOc4RaLwv/eU="
+    },
     "parse-asn1": {
       "version": "5.1.4",
       "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz",
@@ -6996,6 +7016,11 @@
       "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=",
       "dev": true
     },
+    "promise-polyfill": {
+      "version": "7.1.2",
+      "resolved": "https://registry.npm.taobao.org/promise-polyfill/download/promise-polyfill-7.1.2.tgz",
+      "integrity": "sha1-qwUwHYwoU2MBYi1pInYyJppwyjs="
+    },
     "proto-list": {
       "version": "1.2.4",
       "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
@@ -7104,6 +7129,41 @@
       "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=",
       "dev": true
     },
+    "quill": {
+      "version": "1.3.7",
+      "resolved": "https://registry.npm.taobao.org/quill/download/quill-1.3.7.tgz",
+      "integrity": "sha1-2lsvOixHDpMjQM2/NmjJ8h+Shug=",
+      "requires": {
+        "clone": "^2.1.1",
+        "deep-equal": "^1.0.1",
+        "eventemitter3": "^2.0.3",
+        "extend": "^3.0.2",
+        "parchment": "^1.1.4",
+        "quill-delta": "^3.6.2"
+      },
+      "dependencies": {
+        "clone": {
+          "version": "2.1.2",
+          "resolved": "https://registry.npm.taobao.org/clone/download/clone-2.1.2.tgz",
+          "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
+        },
+        "eventemitter3": {
+          "version": "2.0.3",
+          "resolved": "https://registry.npm.taobao.org/eventemitter3/download/eventemitter3-2.0.3.tgz",
+          "integrity": "sha1-teEHm1n7XhuidxwKmTvgYKWMmbo="
+        }
+      }
+    },
+    "quill-delta": {
+      "version": "3.6.3",
+      "resolved": "https://registry.npm.taobao.org/quill-delta/download/quill-delta-3.6.3.tgz",
+      "integrity": "sha1-sZ/SuJQSMBxg4f8hPY2GDqwPEDI=",
+      "requires": {
+        "deep-equal": "^1.0.1",
+        "extend": "^3.0.2",
+        "fast-diff": "1.1.2"
+      }
+    },
     "randomatic": {
       "version": "3.1.1",
       "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz",
@@ -9208,6 +9268,15 @@
         }
       }
     },
+    "vue-quill-editor": {
+      "version": "3.0.6",
+      "resolved": "https://registry.nlark.com/vue-quill-editor/download/vue-quill-editor-3.0.6.tgz",
+      "integrity": "sha1-H4VkYhHWijGoCnLLf0W7LxGbyPs=",
+      "requires": {
+        "object-assign": "^4.1.1",
+        "quill": "^1.3.4"
+      }
+    },
     "vue-resize-sensor": {
       "version": "2.0.0",
       "resolved": "https://registry.npm.taobao.org/vue-resize-sensor/download/vue-resize-sensor-2.0.0.tgz",

+ 14 - 15
fhKeeper/formulahousekeeper/timesheet/src/main.js

@@ -45,11 +45,13 @@ import 'nprogress/nprogress.css'
 
 var addRouFlag = false;
 //角色权限对应关系
-var userModules = [{role:0, modules:["工时报告","自动计时","项目管理"]},
-            {role:3, modules:["工时报告","工时成本统计","项目报表服务","费用报销","项目管理"]},
-            {role:4, modules:["工时报告","财务核算成本", "组织架构"]},
-            {role:5, modules:["工时报告","自动计时","项目管理"]},
-            {role:6, modules:["工时报告","工时成本统计","财务核算成本","项目报表服务","费用报销","项目管理"]},];
+var userModules = [{role:0, modules:["工时报告","项目管理"]},//普通员工
+            {role:1, modules:["工时报告","工时成本统计","项目报表服务","费用报销","项目管理","组织架构","系统基础设置"]},//超级管理员
+            {role:2, modules:["工时报告","工时成本统计","项目报表服务","费用报销","项目管理","组织架构","系统基础设置"]},//系统管理员
+            {role:3, modules:["工时报告","工时成本统计","项目报表服务","费用报销","项目管理"]}, //公司高层
+            {role:4, modules:["财务核算成本", "组织架构"]}, //人事管理员
+            {role:5, modules:["工时报告","项目管理"]}, //项目管理员
+            {role:6, modules:["工时报告","工时成本统计","财务核算成本","项目报表服务","费用报销","项目管理"]},]; //公司领导
 router.beforeEach((to, from, next) => {
     NProgress.start();
     if (to.path == '/register') {
@@ -82,17 +84,14 @@ router.beforeEach((to, from, next) => {
                     filterRouter = allRouters.filter(r=>{return r.name != '客户管理'});
                 }
 
-                if (user.role == 1 || user.role == 2) {
-                    getRoutes = filterRouter;
-                } else {
-                    var modules = userModules.filter(u=>u.role == user.role)[0].modules;
-                    if (user.role == 0 && user.leader) {
-                        modules.push(2, "报告审核");
-                    }
-                    getRoutes = filterRouter.filter(r=>{
-                        return modules.filter(m=>m == r.name).length > 0;
-                    });
+                //过滤权限
+                var modules = userModules.filter(u=>u.role == user.role)[0].modules;
+                if (user.role == 0 && user.leader) {
+                    modules.push(2, "报告审核");
                 }
+                getRoutes = filterRouter.filter(r=>{
+                    return modules.filter(m=>m == r.name).length > 0;
+                });
                 global.antRouter = fixedRouter.concat(getRoutes);
                 router.addRoutes(fixedRouter.concat(getRoutes));
                 router.options.routes = fixedRouter.concat(getRoutes);

+ 11 - 11
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -106,16 +106,16 @@ export const allRouters = [//组织架构
             { path: '/daily', component: daily, name: '工时报告' },
         ]
     },
-    {
-        path: '/',
-        component: Home,
-        name: '自动计时',
-        iconCls: 'iconfont firerock-iconmiaobiao',
-        leaf: true,
-        children: [
-            { path: '/timer', component: timer, name: '自动计时' },
-        ]
-    },
+    // {
+    //     path: '/',
+    //     component: Home,
+    //     name: '自动计时',
+    //     iconCls: 'iconfont firerock-iconmiaobiao',
+    //     leaf: true,
+    //     children: [
+    //         { path: '/timer', component: timer, name: '自动计时' },
+    //     ]
+    // },
     //工时审核
     {
         path: '/',
@@ -232,7 +232,7 @@ export const allRouters = [//组织架构
         
         path: '/',
         component: Home,
-        name: '',
+        name: '系统基础设置',
         iconCls: 'iconfont firerock-iconsetting',
         leaf: true,//只有一个节点
         children: [

+ 4 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/Login.vue

@@ -23,10 +23,11 @@
                             <p><span style="color: #333">QQ:</span><span id="QQ">3052894409</span></p>
                         </div>
                     </el-link>
-                    <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
+                    <span style="margin-right:5px;color:#999;">V3.4.11</span>
+                    <!-- <el-link type="primary" style="margin-right:5px;" @click="dialogVisible=true" :underline="false">
                         使用说明
-                    </el-link>
-                    <el-link type="primary" @click="jumpTo" :underline="false">企业注册</el-link>
+                    </el-link> -->
+                    <!-- <el-link type="primary" @click="jumpTo" :underline="false">企业注册</el-link> -->
                 </div>
             </el-form>
         </div>
@@ -37,7 +38,6 @@
                         target="_blank">工时管家使用说明_项目经理.docx</a></p>
             <p><a style="color:#409EFF;text-decoration:none" href="upload/工时管家使用说明_普通员工.docx" download="工时管家使用说明_普通员工.docx" 
                         target="_blank">工时管家使用说明_普通员工.docx</a></p>
-            
         </el-dialog>
     </div>
 </template>

+ 28 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/expense/expense.vue

@@ -367,12 +367,15 @@
 </template>
 
 <script>
+ import util from "../../common/js/util";
 export default {
   name: "expense",
   components: {},
   props: {},
   data() {
     return {
+      expireDate:'2021-08-31',
+      isTrial:true,
       allExpList:[],
       expenseTypeList:[],
       tian:{a: null,b: null,c: null,d: null,e: null,f: null,g: null,h: null,},
@@ -429,6 +432,12 @@ export default {
     this.getList() // 获取单据列表
     this.getProjectList();
     this.getExpList();
+    if (this.isTrial) {
+      this.$message({
+                            message: "当前为体验版,有效期至2021-08-31.",
+                            type: "warning"
+                            });
+    }
   },
   filters: {
       numberToCurrency(value) {
@@ -637,6 +646,25 @@ export default {
     },
     //创建单据
     add() {
+      
+      if (this.isTrial) {
+        var date = new Date();
+        var dateStr = util.formatDate.format(date, 'yyyy-MM-dd');
+        console.log('date=='+dateStr);
+        if (dateStr >= this.expireDate) {
+          this.$message({type:"error", message:'试用版已到期,请联系客服'});
+          return;
+        }
+        
+      }
+      if (this.invoiceList.length == 0) {
+        this.$message({type:"error", message:"发票列表不能为空"});
+        return;
+      }
+      if (this.addForm.createDate == null || this.addForm.createDate == '') {
+        this.$message({type:"error", message:"填报日期不能为空"});
+        return;
+      }
       // happenDate
       this.addForm.items = JSON.stringify(this.invoiceList)//这里要传发票列表的json转string
       

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -15,7 +15,7 @@
             <el-radio-group v-model="radio" @change="getEchart" style="margin-left:10px;">
                 <el-radio-button label="项目"></el-radio-button>
                 <el-radio-button label="部门"></el-radio-button>
-                <el-radio-button label="人员"></el-radio-button>
+                <el-radio-button v-if="user.role == 6" label="人员"></el-radio-button>
             </el-radio-group>
         </el-col>
         <div id="container" :style="'height:'+containerHeight+'px;'"></div>

+ 4 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/earning.vue

@@ -5,7 +5,10 @@
             <el-col :span="24">    
             <div class="box" style="height:650px;">
                 <div >
-                    <div class="lableTxt">项目利润快照<el-button type="default" size="small" style="float:right;margin-left:10px;" @click="cancelDelete" v-if="deleteTxt == '确认删除'">取消操作</el-button><el-button type="default" size="small" style="float:right;" @click="showDeleteBox">{{deleteTxt}}</el-button></div>
+                    <div class="lableTxt">项目利润快照
+                    <el-button type="default" size="small" style="float:right;margin-left:10px;" 
+                    @click="cancelDelete" v-if="deleteTxt == '确认删除'">取消操作</el-button>
+                    <el-button type="default" size="small" style="float:right;" @click="showDeleteBox" v-if="user.role == 1 || user.role == 2 || user.role == 5">{{deleteTxt}}</el-button></div>
                     <el-divider></el-divider>
                     <!--利润率列表-->
                     <el-table :data="list" highlight-current-row v-loading="listLoading" max-height="300" :height="300" style="width: 100%;" @selection-change="handleSelectionChange">

+ 4 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/project/fileCenter.vue

@@ -37,8 +37,10 @@
                         <!-- </el-link> -->
                     </template>
                 </el-table-column>
-                <el-table-column width="60">
-                <el-button icon="el-icon-download"  circle size="mini" style="margin-left:10px;" @click.stop.native="downloadByA(scope.row)"></el-button>
+                <el-table-column width="60" >
+                    <template slot-scope="scope">
+                        <el-button icon="el-icon-download"  circle size="mini" style="margin-left:10px;" @click.stop.native="downloadByA(scope.row)"></el-button>
+                    </template>
                 </el-table-column>
             </el-table>
         </el-col>

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/list.vue

@@ -900,7 +900,7 @@
                             this.addLoading = false;
                             if (res.code == "ok") {
                                 this.$message({
-                                    message: this.addForm.id!=null?'修改':'创建'+"成功",
+                                    message: (this.addForm.id!=null?'修改':'创建')+"成功",
                                     type: "success"
                                 });
                                 this.addFormVisible = false;

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -224,7 +224,7 @@
             <el-tab-pane label="文件中心" name="files"><FileCenter ref="fileCenter"></FileCenter></el-tab-pane>
             <el-tab-pane label="项目概览" name="info"><ProjectInfo ref="projectInfo" @basecost-change="changeBase"></ProjectInfo></el-tab-pane>
             <el-tab-pane label="数据统计" name="summary"><Summary ref="summary"></Summary></el-tab-pane>
-            <el-tab-pane label="挣值分析" name="earning" v-if="user.role >= 1 && user.role<=3"><Earning ref="earning"></Earning></el-tab-pane>
+            <el-tab-pane label="挣值分析" name="earning" v-if="user.role == 1 || user.role == 2 || user.role == 3 || user.role == 5 || user.role == 6"><Earning ref="earning"></Earning></el-tab-pane>
         </el-tabs>
         
         <!--新增任务界面-->

+ 13 - 10
fhKeeper/formulahousekeeper/timesheet/src/views/team/index.vue

@@ -33,7 +33,7 @@
                     <el-form-item>
                         <div style="color:#999;font-size:13px;">共{{total}}人</div>
                     </el-form-item>
-                    <el-form-item style="float:right;">
+                    <el-form-item style="float:right;" v-if="user.role == 4 || user.role == 6">
                         <el-link type="primary" :underline="false" @click="showExportDialog">导出人员</el-link>
                     </el-form-item>
                     <el-form-item style="float:right;">
@@ -71,10 +71,12 @@
                 <el-table-column label="角色" width="100">
                     <template slot-scope="scope">{{roleArray[scope.row.role]}}</template>
                 </el-table-column>
-                <el-table-column prop="monthCost" label="月成本" sortable>
+                <!--只有人事管理员和公司领导才可以看薪资 -->
+                <el-table-column prop="monthCost" label="月成本" sortable v-if="user.role == 4 || user.role == 6">
                     <template slot-scope="scope">{{scope.row.monthCost==null?0:scope.row.monthCost}} 元</template>
                 </el-table-column>
-                <el-table-column prop="cost" label="时薪" sortable>
+                <!--只有人事管理员和公司领导才可以看薪资 -->
+                <el-table-column prop="cost" label="时薪" sortable v-if="user.role == 4 || user.role == 6">
                     <template slot-scope="scope">{{scope.row.cost==null?0:scope.row.cost}} 元
                         <el-link @click.native="showSalaryList(scope.row)"><i class="iconfont firerock-iconrecord"></i></el-link>
                     </template>
@@ -134,18 +136,18 @@
                 <el-form-item label="电话" prop="phone">
                     <el-input v-model="insertForm.phone" placeholder="请输入电话号码" clearable></el-input>
                 </el-form-item>
-                <el-form-item label="薪酬方式" prop="salaryType">
+                <el-form-item label="薪酬方式" prop="salaryType" v-if="user.role == 4 || user.role == 6">
                     <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
                     <el-radio  :label="0" >固定月成本</el-radio>
                     <el-radio  :label="1">计时工资</el-radio>
                     </el-radio-group>
                 </el-form-item>
-                <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0">
+                <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0 && (user.role == 4 || user.role == 6)" >
                     <el-input v-model.number="insertForm.monthCost" @input="oninput" placeholder="请输入月成本,单位:元" clearable></el-input>
                     <span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
                     <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
                 </el-form-item>
-                <el-form-item label="时薪" prop="cost">
+                <el-form-item label="时薪" prop="cost" v-if="user.role == 4 || user.role == 6">
                     <el-input v-model.number="insertForm.cost" :disabled="insertForm.salaryType == 0" style="width:120px;"
                      placeholder="请输入成本 单位:元/小时" clearable></el-input>
                     <span style="margin-left:25px;">生效日期</span>
@@ -183,18 +185,18 @@
 
         <el-dialog title="修改成本" :visible.sync="dialogVisible1" width="550px" >
             <el-form ref="form1" :model="insertForm" :rules="rules" label-width="80px">
-                <el-form-item label="薪酬方式" prop="salaryType">
+                <el-form-item label="薪酬方式" prop="salaryType" v-if="user.role == 4 || user.role == 6">
                     <el-radio-group v-model="insertForm.salaryType" @change="onSalaryTypeChange">
                     <el-radio  :label="0" >固定月成本</el-radio>
                     <el-radio  :label="1">计时工资</el-radio>
                     </el-radio-group>
                 </el-form-item>
-                <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0">
+                <el-form-item label="月成本" prop="monthCost" v-if="insertForm.salaryType == 0 && (user.role == 4 || user.role == 6)" >
                     <el-input v-model.number="insertForm.monthCost" @input="oninput" placeholder="请输入月成本,单位:元" clearable></el-input>
                     <span style="color:orange;font-size:12px;">按照每个月工作{{timeType.monthDays}}天,每天{{timeType.allday}}小时预估时薪</span>
                     <el-link :underline="false" style="color:blue;font-size:12px;margin-left:7px;" href="#/timetype">修改工作时长</el-link>
                 </el-form-item>
-                <el-form-item label="时薪" prop="cost">
+                <el-form-item label="时薪" prop="cost" v-if="user.role == 4 || user.role == 6">
                     <el-input v-model.number="insertForm.cost" :disabled="insertForm.salaryType == 0" style="width:120px;"
                      placeholder="请输入成本 单位:元/小时" clearable></el-input>
                     <span style="margin-left:25px;">生效日期</span>
@@ -369,6 +371,7 @@
         },
         methods: {
             showConfirmDialog() {
+
                 if (this.toUserId == null || this.toUserId == '') {
                     this.$message({
                             message: '请选择要转让的人员',
@@ -413,7 +416,7 @@
                 },
                 res => {
                     if (res.code == "ok") {
-                        this.allActiveUsers = res.data.records.filter(u=>u.isActive == 1);
+                        this.allActiveUsers = res.data.records.filter(u=>u.isActive == 1 && u.id != this.user.id);
                     } else {
                         this.$message({
                         message: res.msg,

+ 1 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -100,7 +100,7 @@
                                     工作总时长:
                                     <!-- <span :style="parseFloat(item1.reportTime)>parseFloat(item1.calculateTime)+0.5?'color:red':''">{{item1.reportTime}}h</span> -->
                                     <span >{{item1.reportTime}}</span>h
-                                    <span v-if="user.role >=1 && user.role <=3"><span  style="margin-left:10px;">成本:</span>
+                                    <span v-if="user.role ==4 || user.role ==6"><span  style="margin-left:10px;">成本:</span>
                                     <span >{{item1.cost}}</span>元</span>
                                 </span>
                             </span>