From 2a8710c50e2f7c4dd0e333dcf650a2dff960fff4 Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期四, 14 九月 2023 12:46:38 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/zycrm' into zycrm --- src/main/java/com/zy/crm/manager/controller/ContractController.java | 212 ++++ src/main/webapp/static/js/priOnline2/priOnline.js | 90 + src/main/webapp/views/priSales/priSales_more.html | 187 +++ src/main/java/com/zy/crm/manager/entity/PriQuote.java | 14 src/main/webapp/views/contract/contract.html | 16 src/main/webapp/views/priSales/priSales.html | 46 src/main/webapp/views/priQuoteBudget/priQuoteBudget.html | 30 src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java | 4 src/main/java/com/zy/crm/manager/controller/CstmrController.java | 6 src/main/webapp/views/plan/plan_more_other.html | 511 ++++++++++ src/main/webapp/static/js/priQuote/priQuote.js | 36 src/main/java/com/zy/crm/manager/controller/PlanController.java | 17 src/main/java/com/zy/crm/common/model/SettleDto.java | 87 + src/main/java/com/zy/crm/manager/entity/ReimburseOnline.java | 24 src/main/java/com/zy/crm/manager/service/impl/OrderServiceImpl.java | 4 src/main/webapp/static/js/reimburseOnline/reimburseOnline.js | 4 src/main/webapp/views/contract/contract_more.html | 187 +++ src/main/webapp/views/priQuoteBudget/priQuoteBudget_more.html | 187 +++ src/main/resources/mapper/PriOnline2Mapper.xml | 2 src/main/java/com/zy/crm/manager/controller/ReimburseOnlineController.java | 2 src/main/webapp/static/js/common.js | 4 src/main/java/com/zy/crm/manager/controller/OrderController.java | 17 src/main/java/com/zy/crm/manager/entity/Contract.java | 43 src/main/webapp/views/priOnline2/priOnline.html | 14 src/main/java/com/zy/crm/manager/controller/PriQuoteController.java | 1 src/main/java/com/zy/crm/manager/controller/PriOnlineController.java | 8 src/main/java/com/zy/crm/manager/entity/ProcessPermissions.java | 2 src/main/webapp/views/businessTrip/businessTrip.html | 6 src/main/java/com/zy/crm/manager/entity/PriOnline2.java | 52 + src/main/webapp/static/js/priQuoteBudget/priQuoteBudget.js | 87 + src/main/java/com/zy/crm/manager/controller/PriSalesController.java | 183 +++ src/main/resources/mapper/ContractMapper.xml | 3 src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java | 171 +++ src/main/webapp/static/js/contract/contract.js | 53 + src/main/resources/mapper/PriSalesMapper.xml | 1 src/main/webapp/static/js/order/order.js | 36 src/main/java/com/zy/crm/manager/controller/PriQuoteBudgetController.java | 172 +++ src/main/java/com/zy/crm/manager/entity/PriQuoteBudget.java | 50 + src/main/webapp/static/js/priSales/priSales.js | 87 + src/main/webapp/views/priOnline2/priOnline_more.html | 187 +++ src/main/java/com/zy/crm/manager/entity/PriSales.java | 61 + src/main/webapp/views/processPermissions/processPermissions.html | 59 42 files changed, 2,813 insertions(+), 150 deletions(-) diff --git a/src/main/java/com/zy/crm/common/model/SettleDto.java b/src/main/java/com/zy/crm/common/model/SettleDto.java index eef0c43..3b57330 100644 --- a/src/main/java/com/zy/crm/common/model/SettleDto.java +++ b/src/main/java/com/zy/crm/common/model/SettleDto.java @@ -74,7 +74,7 @@ public static List<SettleDto> initPriQuote(Plan plan, User manager ,User president,User user) { List<SettleDto> list = new ArrayList<>(); - for (int i = 1; i < 6; i++) { + for (int i = 1; i < 5; i++) { SettleDto dto = new SettleDto(); dto.setStep(i); switch (i) { @@ -180,7 +180,7 @@ public static List<SettleDto> initBusiness(User manager ,User user) { List<SettleDto> list = new ArrayList<>(); - for (int i = 0; i < 7; i++) { + for (int i = 0; i < 3; i++) { SettleDto dto = new SettleDto(); dto.setStep(i); switch (i) { @@ -205,4 +205,87 @@ return list; } + public static List<SettleDto> initSalesPricing(User manager ,User user,List<String> names ,int nodes) { + List<SettleDto> list = new ArrayList<>(); + for (int i = 0; i < nodes+1; i++) { + SettleDto dto = new SettleDto(); + dto.setStep(i); + switch (i) { + case 0: + dto.setTitle("寮�濮�"); + dto.setMsg(user.getUsername() + names.get(i)); + dto.setUserId(user.getId()); + dto.setUsername(user.getUsername()); + dto.setTime(DateUtils.convert(new Date())); + dto.setCurr(Boolean.TRUE); + list.add(dto); + break; + case 1: + dto.setTitle(names.get(i)); + dto.setUserId(user.getId()); + dto.setUsername(user.getNickname()); + list.add(dto); + break; + case 2: + dto.setTitle(names.get(i)); + dto.setUserId(manager.getId()); + dto.setUsername(manager.getNickname()); + list.add(dto); + break; + case 3: + dto.setTitle(names.get(i)); + list.add(dto); + break; + default: + break; + } + } + return list; + } + + public static List<SettleDto> initContract(User manager ,User user,User president,List<String> names ,int nodes) { + List<SettleDto> list = new ArrayList<>(); + for (int i = 0; i < nodes+1; i++) { + SettleDto dto = new SettleDto(); + dto.setStep(i); + switch (i) { + case 0: + dto.setTitle("寮�濮�"); + dto.setMsg(user.getUsername() + names.get(i)); + dto.setUserId(user.getId()); + dto.setUsername(user.getUsername()); + dto.setTime(DateUtils.convert(new Date())); + dto.setCurr(Boolean.TRUE); + list.add(dto); + break; + case 1: + dto.setTitle(names.get(i)); + dto.setUserId(user.getId()); + dto.setUsername(user.getNickname()); + list.add(dto); + break; + case 2: + dto.setTitle(names.get(i)); + dto.setUserId(manager.getId()); + dto.setUsername(manager.getNickname()); + list.add(dto); + break; + case 3: + dto.setTitle(names.get(i)); + dto.setUserId(president.getId()); + dto.setUsername(president.getNickname()); + list.add(dto); + break; + case 4: + dto.setTitle(names.get(i)); + list.add(dto); + break; + default: + break; + } + } + return list; + } + + } diff --git a/src/main/java/com/zy/crm/manager/controller/ContractController.java b/src/main/java/com/zy/crm/manager/controller/ContractController.java index 94b934b..9faf5ca 100644 --- a/src/main/java/com/zy/crm/manager/controller/ContractController.java +++ b/src/main/java/com/zy/crm/manager/controller/ContractController.java @@ -1,15 +1,16 @@ package com.zy.crm.manager.controller; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.plugins.Page; import com.core.common.DateUtils; +import com.core.exception.CoolException; +import com.zy.crm.common.model.SettleDto; import com.zy.crm.common.service.OssService; -import com.zy.crm.manager.entity.Contract; -import com.zy.crm.manager.entity.ContractSales; -import com.zy.crm.manager.entity.PriOnline; +import com.zy.crm.manager.entity.*; import com.zy.crm.manager.service.ContractSalesService; import com.zy.crm.manager.service.ContractService; import com.core.annotations.ManagerAuth; @@ -18,8 +19,11 @@ import com.core.common.R; import com.core.domain.KeyValueVo; import com.zy.crm.common.web.BaseController; +import com.zy.crm.manager.service.ProcessPermissionsService; import com.zy.crm.manager.utils.ChineseNumberUtils; import com.zy.crm.manager.utils.WordUtils; +import com.zy.crm.system.entity.User; +import com.zy.crm.system.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.InputStreamResource; import org.springframework.http.HttpHeaders; @@ -44,11 +48,20 @@ private ContractSalesService contractSalesService; @Autowired private OssService ossService; + @Autowired + private UserService userService; + @Autowired + private ProcessPermissionsService processPermissionsService; @RequestMapping(value = "/contract/{id}/auth") @ManagerAuth public R get(@PathVariable("id") String id) { - return R.ok(contractService.selectById(String.valueOf(id))); + Contract contract = contractService.selectById(String.valueOf(id)); + assert contract != null; + JSONObject resultObj = JSON.parseObject(JSON.toJSONString(contract)); + // 姝ラ鏉$浉鍏� + resultObj.put("step", contract.getSettle() == 5 ? 0 : contract.getSettle() + 1); + return R.ok().add(resultObj); } @RequestMapping(value = "/contract/list/auth") @@ -68,25 +81,66 @@ } private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ + boolean signUserId = false; + boolean signDeptId = false; + boolean signHostId = false; + for (Map.Entry<String, Object> entry : map.entrySet()){ + if (entry.getKey().equals("dept_id")){ + signDeptId = true; + if (String.valueOf(entry.getValue()).equals("19")){ + signHostId = true; + } + } + } for (Map.Entry<String, Object> entry : map.entrySet()){ String val = String.valueOf(entry.getValue()); if (val.contains(RANGE_TIME_LINK)){ String[] dates = val.split(RANGE_TIME_LINK); wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); + } else if (entry.getKey().equals("dept_id")){ + if (!val.equals("19")){ + wrapper.eq(entry.getKey(), val); + } + } else if (entry.getKey().equals("user_id") && !signDeptId){ + signUserId = true; + wrapper.eq(entry.getKey(), val); } else { wrapper.like(entry.getKey(), val); } + } + if (!signUserId && !signDeptId){ + wrapper.eq("user_id", getUserId()); + } + if (signHostId){ + wrapper.or().eq("host_id",1); } } @RequestMapping(value = "/contract/add/auth") @ManagerAuth(memo = "娣诲姞鍚堝悓") public R add(Contract contract) { + Date now = new Date(); contract.setUserId(getUserId()); //鍒涘缓浜哄憳閮ㄩ棬 contract.setDeptId(getDeptId()); - contract.setCreateTime(new Date()); + contract.setCreateTime(now); + + contract.setSettle(0); + + User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗 + List<String> initNames = new ArrayList<>(); + initNames.add("鍒涘缓浜у搧璐圭敤鏄庣粏妯℃澘"); + initNames.add("鎻愪氦浜у搧璐圭敤鏄庣粏"); + initNames.add("閮ㄩ棬缁忕悊瀹℃牳"); + ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 7).eq("process", "3-1" ));//7锛氬悎鍚岀鐞� + User president = userService.selectById(processPermissions.getUserId()); + initNames.add("鎬昏鍔�"+president.getNickname()+"瀹℃牳"); + initNames.add("涓氬姟鍛樼‘璁�"); + contract.setSettleMsg(JSON.toJSONString(SettleDto.initContract(manager,getUser(),president,initNames,4))); + + contract.setUpdateTime(now); + contract.setUpdateBy(getUserId()); contractService.insert(contract); return R.ok(); } @@ -296,4 +350,152 @@ return R.ok().add(vos); } + @PostMapping(value = "/contracr/approval/auth") + @ManagerAuth + public R approvalBusinessTrip(@RequestParam Long contracrId, + @RequestParam(required = false) Long plannerId){ + Contract contract = contractService.selectById(contracrId); + assert contract != null; + Date now = new Date(); + switch (contract.getSettle()) { + case 0: + User user2 = userService.selectById(contract.getUserId()); + User manager1 = userService.getDeptManager(getHostId(), user2.getDeptId()); + + if (Cools.isEmpty(getUser())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + if (!getUserId().equals(getUser().getId())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list1 = JSON.parseArray(contract.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list1) { + switch (dto.getStep()) { + case 0: + dto.setCurr(Boolean.FALSE); + break; + case 1: + dto.setCurr(Boolean.TRUE); + dto.setMsg(getUser().getNickname() + "鎻愪氦瀹屾垚"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + contract.setSettleMsg(JSON.toJSONString(list1)); + // 淇敼瑙勫垝鍗曠姸鎬� + contract.setSettle(1); + contract.setUpdateTime(now); + + if (!contractService.updateById(contract)) { + throw new CoolException("鎻愪氦澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + case 1: + // 鏈儴闂ㄧ粡鐞嗗鏍� + User user = userService.selectById(contract.getUserId()); + User manager = userService.getDeptManager(getHostId(), user.getDeptId()); + if (manager.getId().equals(getUserId())) { + + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list = JSON.parseArray(contract.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list) { + switch (dto.getStep()) { + case 1: + dto.setCurr(Boolean.FALSE); + break; + case 2: + dto.setCurr(Boolean.TRUE); + dto.setMsg("閮ㄩ棬缁忕悊" + manager.getNickname() + "瀹℃壒閫氳繃"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + contract.setSettleMsg(JSON.toJSONString(list)); + + // 淇敼瑙勫垝鍗曠姸鎬� + contract.setSettle(2); // 鐢宠閫氳繃 + contract.setUpdateTime(now); + if (!contractService.updateById(contract)) { + throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + } else { + return R.error("鎶辨瓑锛屾偍娌℃湁瀹℃牳鐨勬潈闄愶紒锛侊紒"); + } + break; + case 2: + ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 7).eq("process", "3-1"));//3锛氭姤閿�娴佺▼ + User planLeader = userService.selectById(processPermissions.getUserId()); // 鑾峰彇鍚堝悓绠$悊娴佺▼鑺傜偣纭浜� + + if (planLeader.getId().equals(getUserId())) { + + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list = JSON.parseArray(contract.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list) { + switch (dto.getStep()) { + case 2: + dto.setCurr(Boolean.FALSE); + break; + case 3: + dto.setCurr(Boolean.TRUE); + dto.setMsg("鎬昏鍔�" + planLeader.getNickname() + "瀹℃壒閫氳繃"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + contract.setSettleMsg(JSON.toJSONString(list)); + + // 淇敼瑙勫垝鍗曠姸鎬� + contract.setSettle(3); // 鐢宠閫氳繃 + contract.setUpdateTime(now); + if (!contractService.updateById(contract)) { + throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + } else { + return R.error("鎶辨瓑锛屾偍娌℃湁瀹℃牳鐨勬潈闄愶紒锛侊紒"); + } + break; + case 3: + // 涓氬姟鍛� + User salesman0 = userService.selectById(contract.getUserId()); + if (!getUserId().equals(salesman0.getId())) { + return R.error("鎶辨瓑锛屾偍鏃犻渶纭锛侊紒锛�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list2 = JSON.parseArray(contract.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list2) { + switch (dto.getStep()) { + case 3: + dto.setCurr(Boolean.TRUE); + break; + case 4: + dto.setCurr(Boolean.TRUE); + dto.setMsg("涓氬姟鍛�" + salesman0.getNickname() + "浠ョ‘璁�"); + dto.setTime(DateUtils.convert(new Date())); + break; + default: + break; + } + } + contract.setSettleMsg(JSON.toJSONString(list2)); + // 淇敼瑙勫垝鍗曠姸鎬� + contract.setSettle(4); // 瀹℃壒閫氳繃 + contract.setUpdateTime(new Date()); + + if (!contractService.updateById(contract)) { + throw new CoolException("纭澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + default: + return R.error(); + } + return R.ok("瀹℃壒鎴愬姛"); + } + } diff --git a/src/main/java/com/zy/crm/manager/controller/CstmrController.java b/src/main/java/com/zy/crm/manager/controller/CstmrController.java index 75ffe4d..69d029b 100644 --- a/src/main/java/com/zy/crm/manager/controller/CstmrController.java +++ b/src/main/java/com/zy/crm/manager/controller/CstmrController.java @@ -153,9 +153,9 @@ @ManagerAuth(memo = "鍒犻櫎鐢叉柟鍗曚綅") public R delete(@RequestParam(value="ids[]") Long[] ids){ for (Long id : ids){ - int cstmr_id = orderService.selectCount(new EntityWrapper<Order>().eq("cstmr_id", id)); - if (cstmr_id!=0){ - return R.error("瀛樺湪鍏宠仈璺熻釜椤圭洰锛岀姝㈠垹闄わ紒锛侊紒"); + int order = orderService.selectCount(new EntityWrapper<Order>().eq("cstmr_id", id)); + if (order!=0){ + return R.error("瀛樺湪鍏宠仈鐨勮窡韪」鐩紝绂佹鍒犻櫎锛侊紒锛�"); } cstmrService.deleteById(id); } diff --git a/src/main/java/com/zy/crm/manager/controller/OrderController.java b/src/main/java/com/zy/crm/manager/controller/OrderController.java index 96c5bb2..27455e0 100644 --- a/src/main/java/com/zy/crm/manager/controller/OrderController.java +++ b/src/main/java/com/zy/crm/manager/controller/OrderController.java @@ -15,8 +15,10 @@ import com.zy.crm.manager.entity.CstmrFoll; import com.zy.crm.manager.entity.Order; import com.zy.crm.manager.entity.OrderFoll; +import com.zy.crm.manager.entity.Plan; import com.zy.crm.manager.service.OrderFollService; import com.zy.crm.manager.service.OrderService; +import com.zy.crm.manager.service.PlanService; import com.zy.crm.system.entity.Role; import com.zy.crm.system.entity.User; import com.zy.crm.system.service.UserService; @@ -40,6 +42,8 @@ @Autowired private OrderService orderService; + @Autowired + private PlanService planService; @RequestMapping(value = "/order/{id}/auth") @ManagerAuth @@ -91,6 +95,13 @@ return R.ok(); } + @RequestMapping(value = "/order/userName/userId/auth") + @ManagerAuth(memo = "娣诲姞璺熻釜椤圭洰鑾峰彇褰撳墠鐧诲綍璐﹀彿淇℃伅") + public R userNameAndUserId() { + KeyValueVo keyValueVo = new KeyValueVo(getUser().getNickname(),getUserId()); + return R.ok().add(keyValueVo); + } + @RequestMapping(value = "/order/update/auth") @ManagerAuth(memo = "鏇存柊璺熻釜椤圭洰") public R update(Order order){ @@ -107,8 +118,12 @@ @ManagerAuth(memo = "鍒犻櫎璺熻釜椤圭洰") public R delete(@RequestParam(value="ids[]") Long[] ids){ for (Long id : ids){ + int plan = planService.selectCount(new EntityWrapper<Plan>().eq("order_id", id)); + if (plan!=0){ + return R.error("瀛樺湪鍏宠仈鐨勮鍒掑崟锛岀姝㈠垹闄わ紒锛侊紒"); + } orderService.deleteById(id); - } + } return R.ok(); } diff --git a/src/main/java/com/zy/crm/manager/controller/PlanController.java b/src/main/java/com/zy/crm/manager/controller/PlanController.java index 0b45b3d..178b6ef 100644 --- a/src/main/java/com/zy/crm/manager/controller/PlanController.java +++ b/src/main/java/com/zy/crm/manager/controller/PlanController.java @@ -19,13 +19,8 @@ import com.zy.crm.common.utils.SetOfUtils; import com.zy.crm.common.web.BaseController; import com.zy.crm.manager.controller.result.FollowerTableVo; -import com.zy.crm.manager.entity.Order; -import com.zy.crm.manager.entity.Plan; -import com.zy.crm.manager.entity.PlanFoll; -import com.zy.crm.manager.entity.PlanType; -import com.zy.crm.manager.service.PlanFollService; -import com.zy.crm.manager.service.PlanService; -import com.zy.crm.manager.service.PlanTypeService; +import com.zy.crm.manager.entity.*; +import com.zy.crm.manager.service.*; import com.zy.crm.system.entity.User; import com.zy.crm.system.service.DeptService; import com.zy.crm.system.service.UserService; @@ -64,6 +59,8 @@ private DeptService deptService; @Autowired private OssService ossService; + @Autowired + private PriOnline2Service priOnline2Service; @GetMapping(value = "/plan/{id}/auth") @ManagerAuth @@ -215,7 +212,11 @@ @ManagerAuth(memo = "鍒犻櫎瑙勫垝鐢宠鍗�") public R delete(@RequestParam(value="ids[]") Long[] ids){ for (Long id : ids){ - planService.deleteById(id); + int priOnline2 = priOnline2Service.selectCount(new EntityWrapper<PriOnline2>().eq("item_id", id)); + if (priOnline2!=0){ + return R.error("瀛樺湪鍏宠仈鐨勬牳浠峰崟锛岀姝㈠垹闄わ紒锛侊紒"); + } + planService.deleteById(id); } return R.ok(); } diff --git a/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java b/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java index f6d9471..a5f868f 100644 --- a/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java +++ b/src/main/java/com/zy/crm/manager/controller/PriOnline2Controller.java @@ -1,5 +1,6 @@ package com.zy.crm.manager.controller; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; @@ -10,13 +11,13 @@ import com.core.common.DateUtils; import com.core.common.R; import com.core.domain.KeyValueVo; +import com.core.exception.CoolException; +import com.zy.crm.common.model.SettleDto; import com.zy.crm.common.web.BaseController; -import com.zy.crm.manager.entity.Plan; -import com.zy.crm.manager.entity.Pri; -import com.zy.crm.manager.entity.PriOnline2; -import com.zy.crm.manager.service.PlanService; -import com.zy.crm.manager.service.PriOnline2Service; -import com.zy.crm.manager.service.PriService; +import com.zy.crm.manager.entity.*; +import com.zy.crm.manager.service.*; +import com.zy.crm.system.entity.User; +import com.zy.crm.system.service.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ClassPathResource; import org.springframework.util.ClassUtils; @@ -40,10 +41,24 @@ @Autowired private PlanService planService; + @Autowired + private PriSalesService priSalesService; + + @Autowired + private CstmrService cstmrService; + + @Autowired + private UserService userService; + @RequestMapping(value = "/priOnline2/{id}/auth") @ManagerAuth public R get(@PathVariable("id") String id) { - return R.ok(priOnline2Service.selectById(String.valueOf(id))); + PriOnline2 priOnline2 = priOnline2Service.selectById(String.valueOf(id)); + assert priOnline2 != null; + JSONObject resultObj = JSON.parseObject(JSON.toJSONString(priOnline2)); + // 姝ラ鏉$浉鍏� + resultObj.put("step", priOnline2.getSettle() == 4 ? 0 : priOnline2.getSettle() + 1); + return R.ok().add(resultObj); } @RequestMapping(value = "/priOnline2/viewCheck/{id}/auth") @@ -65,7 +80,7 @@ @RequestParam(required = false)String condition, @RequestParam Map<String, Object> param){ EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>(); - wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId"); + wrapper.setSqlSelect("id,title,create_time as createTime,filepath,settle,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,dept_id as deptId,status,update_time as updateTime,check_data as checkData,update_user_id as updateUserId,member_id as memberId"); wrapper.in("member_id", getUserRoleBelongsToUserId("allopen")); excludeTrash(param); convert(param, wrapper); @@ -111,7 +126,7 @@ PriOnline2 priOnline2 = new PriOnline2(); priOnline2.setCreateTime(new Date()); priOnline2.setTitle(map.get("title").toString()); - priOnline2.setTemplateName(map.get("title").toString()); +// priOnline2.setTemplateName(map.get("title").toString()); priOnline2.setSheetData(map.get("sheetData").toString()); priOnline2.setItemId(Long.parseLong(map.get("itemId").toString())); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); @@ -126,11 +141,24 @@ priOnline2.setUpdateUserId(getUserId()); //鐘舵�侊紝鏈畬鎴� priOnline2.setStatus(0); + //涓氬姟鍛� // Item item = itemService.selectById(priOnline.getItemId()); Plan plan = planService.selectById(priOnline2.getItemId()); priOnline2.setMemberId(plan.getUserId()); + Cstmr cstmr = cstmrService.selectById(plan.getCstmrId()); + priOnline2.setTemplateName(cstmr.getName()); //鐢叉柟鍗曚綅鍚嶇О + + priOnline2.setSettle(0); + + User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗 + List<String> initNames = new ArrayList<>(); + initNames.add("鍒涘缓鏍镐环鍗曟ā鏉�"); + initNames.add("鎻愪氦鏍镐环"); + initNames.add("閮ㄩ棬缁忕悊瀹℃牳"); + initNames.add("涓氬姟鍛樼‘璁�"); + priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricing(manager,getUser(),initNames,3))); //璁剧疆椤圭洰娴佺▼ plan.setStep(2); @@ -277,6 +305,12 @@ if (Cools.isEmpty(ids)){ return R.error(); } + for (Long id : ids){ + int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id)); + if (priSales!=0){ + return R.error("瀛樺湪鍏宠仈鐨勪骇鍝佽垂鐢ㄦ槑缁嗭紝绂佹鍒犻櫎锛侊紒锛�"); + } + } priOnline2Service.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } @@ -303,7 +337,8 @@ for (PriOnline2 priOnline2 : page.getRecords()){ Map<String, Object> map = new HashMap<>(); map.put("id", priOnline2.getId()); - map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$()); +// map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getPlanId$() + "/" + priOnline2.getMemberId$()); + map.put("value", priOnline2.getOrderNum() + "/" + priOnline2.getTemplateName()); result.add(map); } return R.ok(result); @@ -328,4 +363,120 @@ return R.ok().add(vos); } + @PostMapping(value = "/priOnline2/approval/auth") + @ManagerAuth + public R approvalBusinessTrip(@RequestParam Long priOnlineId, + @RequestParam(required = false) Long plannerId){ + PriOnline2 priOnline2 = priOnline2Service.selectById(priOnlineId); + assert priOnline2 != null; + Date now = new Date(); + switch (priOnline2.getSettle()) { + case 0: + User user2 = userService.selectById(priOnline2.getUserId()); + User manager1 = userService.getDeptManager(getHostId(), user2.getDeptId()); + + if (Cools.isEmpty(getUser())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + if (!getUserId().equals(getUser().getId())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list1 = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list1) { + switch (dto.getStep()) { + case 0: + dto.setCurr(Boolean.FALSE); + break; + case 1: + dto.setCurr(Boolean.TRUE); + dto.setMsg(getUser().getNickname() + "鎻愪氦瀹屾垚"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + priOnline2.setSettleMsg(JSON.toJSONString(list1)); + // 淇敼瑙勫垝鍗曠姸鎬� + priOnline2.setSettle(1); + priOnline2.setUpdateUserId(getUserId()); + priOnline2.setUpdateTime(now); + priOnline2.setMemberId(manager1.getId()); + + if (!priOnline2Service.updateById(priOnline2)) { + throw new CoolException("鎻愪氦澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + case 1: + // 鏈儴闂ㄧ粡鐞嗗鏍� + User user = userService.selectById(priOnline2.getUserId()); + User manager = userService.getDeptManager(getHostId(), user.getDeptId()); + if (manager.getId().equals(getUserId())) { + + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list) { + switch (dto.getStep()) { + case 1: + dto.setCurr(Boolean.FALSE); + break; + case 2: + dto.setCurr(Boolean.TRUE); + dto.setMsg("閮ㄩ棬缁忕悊" + manager.getNickname() + "瀹℃壒閫氳繃"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + priOnline2.setSettleMsg(JSON.toJSONString(list)); + + // 淇敼瑙勫垝鍗曠姸鎬� + priOnline2.setSettle(2); // 鐢宠閫氳繃 + priOnline2.setUpdateTime(now); + if (!priOnline2Service.updateById(priOnline2)) { + throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + } else { + return R.error("鎶辨瓑锛屾偍娌℃湁瀹℃牳鐨勬潈闄愶紒锛侊紒"); + } + break; + case 2: + // 涓氬姟鍛� + User salesman0 = userService.selectById(priOnline2.getUserId()); + if (!getUserId().equals(salesman0.getId())) { + return R.error("鎶辨瓑锛屾偍鏃犻渶纭锛侊紒锛�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list2 = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list2) { + switch (dto.getStep()) { + case 2: + dto.setCurr(Boolean.TRUE); + break; + case 3: + dto.setCurr(Boolean.TRUE); + dto.setMsg("涓氬姟鍛�" + salesman0.getNickname() + "浠ョ‘璁�"); + dto.setTime(DateUtils.convert(new Date())); + break; + default: + break; + } + } + priOnline2.setSettleMsg(JSON.toJSONString(list2)); + // 淇敼瑙勫垝鍗曠姸鎬� + priOnline2.setSettle(3); // 瀹℃壒閫氳繃 + priOnline2.setUpdateTime(new Date()); + + if (!priOnline2Service.updateById(priOnline2)) { + throw new CoolException("纭澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + default: + return R.error(); + } + return R.ok("瀹℃壒鎴愬姛"); + } + } diff --git a/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java b/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java index 6f155f2..6e0f136 100644 --- a/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java +++ b/src/main/java/com/zy/crm/manager/controller/PriOnlineController.java @@ -72,12 +72,15 @@ } private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ - Long deptId = getDeptId(); boolean signUserId = false; boolean signDeptId = false; + boolean signHostId = false; for (Map.Entry<String, Object> entry : map.entrySet()){ if (entry.getKey().equals("dept_id")){ signDeptId = true; + if (String.valueOf(entry.getValue()).equals("19")){ + signHostId = true; + } } } for (Map.Entry<String, Object> entry : map.entrySet()){ @@ -100,6 +103,9 @@ if (!signUserId && !signDeptId){ wrapper.eq("user_id", getUserId()); } + if (signHostId){ + wrapper.or().eq("host_id",1); + } } @RequestMapping(value = "/priOnline/add/auth") diff --git a/src/main/java/com/zy/crm/manager/controller/PriQuoteBudgetController.java b/src/main/java/com/zy/crm/manager/controller/PriQuoteBudgetController.java index e8aadad..c69e126 100644 --- a/src/main/java/com/zy/crm/manager/controller/PriQuoteBudgetController.java +++ b/src/main/java/com/zy/crm/manager/controller/PriQuoteBudgetController.java @@ -1,5 +1,6 @@ package com.zy.crm.manager.controller; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; @@ -11,15 +12,13 @@ import com.core.common.DateUtils; import com.core.common.R; import com.core.domain.KeyValueVo; +import com.core.exception.CoolException; +import com.zy.crm.common.model.SettleDto; import com.zy.crm.common.web.BaseController; -import com.zy.crm.manager.entity.Item; -import com.zy.crm.manager.entity.Plan; -import com.zy.crm.manager.entity.PriQuoteBudget; -import com.zy.crm.manager.entity.PriSales; -import com.zy.crm.manager.service.ItemService; -import com.zy.crm.manager.service.PlanService; -import com.zy.crm.manager.service.PriQuoteBudgetService; -import com.zy.crm.manager.service.PriSalesService; +import com.zy.crm.manager.entity.*; +import com.zy.crm.manager.service.*; +import com.zy.crm.system.entity.User; +import com.zy.crm.system.service.UserService; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; @@ -44,10 +43,21 @@ @Autowired private PriSalesService priSalesService; + @Autowired + private PriQuoteService priQuoteService; + + @Autowired + private UserService userService; + @RequestMapping(value = "/priQuoteBudget/{id}/auth") @ManagerAuth public R get(@PathVariable("id") String id) { - return R.ok(priQuoteBudgetService.selectById(String.valueOf(id))); + PriQuoteBudget priQuoteBudget = priQuoteBudgetService.selectById(String.valueOf(id)); + assert priQuoteBudget != null; + JSONObject resultObj = JSON.parseObject(JSON.toJSONString(priQuoteBudget)); + // 姝ラ鏉$浉鍏� + resultObj.put("step", priQuoteBudget.getSettle() == 4 ? 0 : priQuoteBudget.getSettle() + 1); + return R.ok().add(resultObj); } @RequestMapping(value = "/priQuoteBudget/list/auth") @@ -59,7 +69,7 @@ @RequestParam(required = false)String condition, @RequestParam Map<String, Object> param){ EntityWrapper<PriQuoteBudget> wrapper = new EntityWrapper<>(); - wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,update_user_id as updateUserId,update_time as updateTime,in_order_num as inOrderNum,member_id as memberId"); + wrapper.setSqlSelect("id,title,create_time as createTime,settle,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,update_user_id as updateUserId,update_time as updateTime,in_order_num as inOrderNum,member_id as memberId"); wrapper.in("member_id", getUserRoleBelongsToUserId()); excludeTrash(param); convert(param, wrapper); @@ -71,9 +81,13 @@ private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ boolean signUserId = false; boolean signDeptId = false; + boolean signHostId = false; for (Map.Entry<String, Object> entry : map.entrySet()){ if (entry.getKey().equals("dept_id")){ signDeptId = true; + if (String.valueOf(entry.getValue()).equals("19")){ + signHostId = true; + } } } for (Map.Entry<String, Object> entry : map.entrySet()){ @@ -96,6 +110,9 @@ if (!signUserId && !signDeptId){ wrapper.eq("user_id", getUserId()); } + if (signHostId){ + wrapper.or().eq("host_id",1); + } } @RequestMapping(value = "/priQuoteBudget/add/auth") @@ -108,6 +125,7 @@ priQuoteBudget.setTitle(map.get("title").toString()); priQuoteBudget.setTemplateName(priSales.getTemplateName()); priQuoteBudget.setSheetData(map.get("sheetData").toString()); + priQuoteBudget.setPriSalesId(Long.parseLong(map.get("priSalesId").toString())); priQuoteBudget.setItemId(priSales.getItemId()); //淇濆瓨浜у搧璐圭敤鏄庣粏璁㈠崟鍙� priQuoteBudget.setOrderNum(priSales.getInOrderNum()); @@ -125,6 +143,16 @@ //涓氬姟鍛� Plan plan = planService.selectById(priQuoteBudget.getItemId()); priQuoteBudget.setMemberId(plan.getUserId()); + + priQuoteBudget.setSettle(0); + + User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗 + List<String> initNames = new ArrayList<>(); + initNames.add("鍒涘缓鎶ヤ环棰勭畻鍗曟ā鏉�"); + initNames.add("鎻愪氦鎶ヤ环棰勭畻鍗�"); + initNames.add("閮ㄩ棬缁忕悊瀹℃牳"); + initNames.add("涓氬姟鍛樼‘璁�"); + priQuoteBudget.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricing(manager,getUser(),initNames,3))); //璁剧疆椤圭洰娴佺▼ plan.setStep(4); @@ -199,6 +227,12 @@ if (Cools.isEmpty(ids)){ return R.error(); } + for (Long id : ids){ + int priQuote= priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("ori_quote_budget_id", id)); + if (priQuote!=0){ + return R.error("瀛樺湪鍏宠仈鐨勬姤浠峰崟锛岀姝㈠垹闄わ紒锛侊紒"); + } + } priQuoteBudgetService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } @@ -225,7 +259,7 @@ for (PriQuoteBudget priQuoteBudget : page.getRecords()){ Map<String, Object> map = new HashMap<>(); map.put("id", priQuoteBudget.getId()); - map.put("value", priQuoteBudget.getInOrderNum() + "/" + priQuoteBudget.getPlanId$() + "/" + priQuoteBudget.getMemberId$()); + map.put("value", priQuoteBudget.getInOrderNum() + "/" + priQuoteBudget.getPlanId$() + "/" + priQuoteBudget.getMemberId$() + "/" + priQuoteBudget.getTemplateName()); result.add(map); } return R.ok(result); @@ -398,4 +432,120 @@ } } + @PostMapping(value = "/priQuoteBudget/approval/auth") + @ManagerAuth + public R approvalBusinessTrip(@RequestParam Long priQuoteBudgetId, + @RequestParam(required = false) Long plannerId){ + PriQuoteBudget priQuoteBudget = priQuoteBudgetService.selectById(priQuoteBudgetId); + assert priQuoteBudget != null; + Date now = new Date(); + switch (priQuoteBudget.getSettle()) { + case 0: + User user2 = userService.selectById(priQuoteBudget.getUserId()); + User manager1 = userService.getDeptManager(getHostId(), user2.getDeptId()); + + if (Cools.isEmpty(getUser())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + if (!getUserId().equals(getUser().getId())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list1 = JSON.parseArray(priQuoteBudget.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list1) { + switch (dto.getStep()) { + case 0: + dto.setCurr(Boolean.FALSE); + break; + case 1: + dto.setCurr(Boolean.TRUE); + dto.setMsg(getUser().getNickname() + "鎻愪氦瀹屾垚"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + priQuoteBudget.setSettleMsg(JSON.toJSONString(list1)); + // 淇敼瑙勫垝鍗曠姸鎬� + priQuoteBudget.setSettle(1); + priQuoteBudget.setUpdateUserId(getUserId()); + priQuoteBudget.setUpdateTime(now); + priQuoteBudget.setMemberId(manager1.getId()); + + if (!priQuoteBudgetService.updateById(priQuoteBudget)) { + throw new CoolException("鎻愪氦澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + case 1: + // 鏈儴闂ㄧ粡鐞嗗鏍� + User user = userService.selectById(priQuoteBudget.getUserId()); + User manager = userService.getDeptManager(getHostId(), user.getDeptId()); + if (manager.getId().equals(getUserId())) { + + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list = JSON.parseArray(priQuoteBudget.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list) { + switch (dto.getStep()) { + case 1: + dto.setCurr(Boolean.FALSE); + break; + case 2: + dto.setCurr(Boolean.TRUE); + dto.setMsg("閮ㄩ棬缁忕悊" + manager.getNickname() + "瀹℃壒閫氳繃"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + priQuoteBudget.setSettleMsg(JSON.toJSONString(list)); + + // 淇敼瑙勫垝鍗曠姸鎬� + priQuoteBudget.setSettle(2); // 鐢宠閫氳繃 + priQuoteBudget.setUpdateTime(now); + if (!priQuoteBudgetService.updateById(priQuoteBudget)) { + throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + } else { + return R.error("鎶辨瓑锛屾偍娌℃湁瀹℃牳鐨勬潈闄愶紒锛侊紒"); + } + break; + case 2: + // 涓氬姟鍛� + User salesman0 = userService.selectById(priQuoteBudget.getUserId()); + if (!getUserId().equals(salesman0.getId())) { + return R.error("鎶辨瓑锛屾偍鏃犻渶纭锛侊紒锛�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list2 = JSON.parseArray(priQuoteBudget.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list2) { + switch (dto.getStep()) { + case 2: + dto.setCurr(Boolean.TRUE); + break; + case 3: + dto.setCurr(Boolean.TRUE); + dto.setMsg("涓氬姟鍛�" + salesman0.getNickname() + "浠ョ‘璁�"); + dto.setTime(DateUtils.convert(new Date())); + break; + default: + break; + } + } + priQuoteBudget.setSettleMsg(JSON.toJSONString(list2)); + // 淇敼瑙勫垝鍗曠姸鎬� + priQuoteBudget.setSettle(3); // 瀹℃壒閫氳繃 + priQuoteBudget.setUpdateTime(new Date()); + + if (!priQuoteBudgetService.updateById(priQuoteBudget)) { + throw new CoolException("纭澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + default: + return R.error(); + } + return R.ok("瀹℃壒鎴愬姛"); + } + } diff --git a/src/main/java/com/zy/crm/manager/controller/PriQuoteController.java b/src/main/java/com/zy/crm/manager/controller/PriQuoteController.java index 3e15a2a..51e0baa 100644 --- a/src/main/java/com/zy/crm/manager/controller/PriQuoteController.java +++ b/src/main/java/com/zy/crm/manager/controller/PriQuoteController.java @@ -129,6 +129,7 @@ priQuote.setTitle(map.get("title").toString()); priQuote.setTemplateName(priQuoteBudget.getTemplateName()); priQuote.setSheetData(map.get("sheetData").toString()); + priQuote.setOriQuoteBudgetId(Long.parseLong(map.get("priQuoteBudgetId").toString())); priQuote.setItemId(priQuoteBudget.getItemId()); priQuote.setOrderNum(priQuoteBudget.getInOrderNum()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); diff --git a/src/main/java/com/zy/crm/manager/controller/PriSalesController.java b/src/main/java/com/zy/crm/manager/controller/PriSalesController.java index f14abcb..f3be605 100644 --- a/src/main/java/com/zy/crm/manager/controller/PriSalesController.java +++ b/src/main/java/com/zy/crm/manager/controller/PriSalesController.java @@ -1,5 +1,6 @@ package com.zy.crm.manager.controller; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; @@ -11,15 +12,13 @@ import com.core.common.Cools; import com.core.common.R; import com.core.domain.KeyValueVo; +import com.core.exception.CoolException; +import com.zy.crm.common.model.SettleDto; import com.zy.crm.common.web.BaseController; -import com.zy.crm.manager.entity.Item; -import com.zy.crm.manager.entity.Plan; -import com.zy.crm.manager.entity.PriOnline; -import com.zy.crm.manager.entity.PriSales; -import com.zy.crm.manager.service.ItemService; -import com.zy.crm.manager.service.PlanService; -import com.zy.crm.manager.service.PriOnlineService; -import com.zy.crm.manager.service.PriSalesService; +import com.zy.crm.manager.entity.*; +import com.zy.crm.manager.service.*; +import com.zy.crm.system.entity.User; +import com.zy.crm.system.service.UserService; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; @@ -39,15 +38,26 @@ private PriSalesService priSalesService; @Autowired - private PriOnlineService priOnlineService; + private PriOnline2Service priOnline2Service; @Autowired private PlanService planService; + @Autowired + private PriQuoteBudgetService priQuoteBudgetService; + + @Autowired + private UserService userService; + @RequestMapping(value = "/priSales/{id}/auth") @ManagerAuth public R get(@PathVariable("id") String id) { - return R.ok(priSalesService.selectById(String.valueOf(id))); + PriSales priSales = priSalesService.selectById(String.valueOf(id)); + assert priSales != null; + JSONObject resultObj = JSON.parseObject(JSON.toJSONString(priSales)); + // 姝ラ鏉$浉鍏� + resultObj.put("step", priSales.getSettle() == 4 ? 0 : priSales.getSettle() + 1); + return R.ok().add(resultObj); } @RequestMapping(value = "/priSales/list/auth") @@ -59,7 +69,7 @@ @RequestParam(required = false)String condition, @RequestParam Map<String, Object> param){ EntityWrapper<PriSales> wrapper = new EntityWrapper<>(); - wrapper.setSqlSelect("id,title,create_time as createTime,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,update_user_id as updateUserId,update_time as updateTime,in_order_num as inOrderNum,member_id as memberId"); + wrapper.setSqlSelect("id,title,create_time as createTime,settle,filepath,item_id as itemId,order_num as orderNum,template_name as templateName,user_id as userId,update_user_id as updateUserId,update_time as updateTime,in_order_num as inOrderNum,member_id as memberId"); wrapper.in("member_id", getUserRoleBelongsToUserId("allopen")); excludeTrash(param); convert(param, wrapper); @@ -71,9 +81,13 @@ private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ boolean signUserId = false; boolean signDeptId = false; + boolean signHostId = false; for (Map.Entry<String, Object> entry : map.entrySet()){ if (entry.getKey().equals("dept_id")){ signDeptId = true; + if (String.valueOf(entry.getValue()).equals("19")){ + signHostId = true; + } } } for (Map.Entry<String, Object> entry : map.entrySet()){ @@ -96,20 +110,24 @@ if (!signUserId && !signDeptId){ wrapper.eq("user_id", getUserId()); } + if (signHostId){ + wrapper.or().eq("host_id",1); + } } @RequestMapping(value = "/priSales/add/auth") @ManagerAuth(memo = "娣诲姞浜у搧璐圭敤鏄庣粏") public R add(@RequestBody Map<String,Object> map) { - PriOnline priOnline = priOnlineService.selectById(Long.parseLong(map.get("priOnlineId").toString())); + PriOnline2 priOnline2 = priOnline2Service.selectById(Long.parseLong(map.get("priOnlineId").toString())); PriSales priSales = new PriSales(); priSales.setCreateTime(new Date()); priSales.setTitle(map.get("title").toString()); - priSales.setTemplateName(priOnline.getTemplateName()); + priSales.setTemplateName(priOnline2.getTemplateName()); priSales.setSheetData(map.get("sheetData").toString()); - priSales.setItemId(priOnline.getItemId()); - priSales.setOrderNum(priOnline.getOrderNum()); + priSales.setPriOnline2Id(Long.parseLong(map.get("priOnlineId").toString())); + priSales.setItemId(priOnline2.getItemId()); + priSales.setOrderNum(priOnline2.getOrderNum()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); priSales.setInOrderNum(format.format(new Date())); @@ -124,6 +142,16 @@ //涓氬姟鍛� Plan plan = planService.selectById(priSales.getItemId()); priSales.setMemberId(plan.getUserId()); + + priSales.setSettle(0); + + User manager = userService.getDeptManager(getHostId(), getUser().getDeptId()); // 鑾峰彇閮ㄩ棬棰嗗 + List<String> initNames = new ArrayList<>(); + initNames.add("鍒涘缓浜у搧璐圭敤鏄庣粏妯℃澘"); + initNames.add("鎻愪氦浜у搧璐圭敤鏄庣粏"); + initNames.add("閮ㄩ棬缁忕悊瀹℃牳"); + initNames.add("涓氬姟鍛樼‘璁�"); + priSales.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricing(manager,getUser(),initNames,3))); //璁剧疆椤圭洰娴佺▼ plan.setStep(3); @@ -198,6 +226,12 @@ if (Cools.isEmpty(ids)){ return R.error(); } + for (Long id : ids){ + int priQuoteBudget= priQuoteBudgetService.selectCount(new EntityWrapper<PriQuoteBudget>().eq("pri_sales_id", id)); + if (priQuoteBudget!=0){ + return R.error("瀛樺湪鍏宠仈鐨勬姤浠烽绠楀崟锛岀姝㈠垹闄わ紒锛侊紒"); + } + } priSalesService.deleteBatchIds(Arrays.asList(ids)); return R.ok(); } @@ -224,7 +258,7 @@ for (PriSales priSales : page.getRecords()){ Map<String, Object> map = new HashMap<>(); map.put("id", priSales.getId()); - map.put("value", priSales.getInOrderNum() + "/" + priSales.getPlanId$() + "/" + priSales.getMemberId$()); + map.put("value", priSales.getInOrderNum() + "/" + priSales.getPlanId$() + "/" + priSales.getMemberId$()+"/" + priSales.getTemplateName()); result.add(map); } return R.ok(result); @@ -411,4 +445,121 @@ } } + + @PostMapping(value = "/priSales/approval/auth") + @ManagerAuth + public R approvalBusinessTrip(@RequestParam Long priSalesId, + @RequestParam(required = false) Long plannerId){ + PriSales priSales = priSalesService.selectById(priSalesId); + assert priSales != null; + Date now = new Date(); + switch (priSales.getSettle()) { + case 0: + User user2 = userService.selectById(priSales.getUserId()); + User manager1 = userService.getDeptManager(getHostId(), user2.getDeptId()); + + if (Cools.isEmpty(getUser())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + if (!getUserId().equals(getUser().getId())) { + return R.error("鎶辨瓑锛屾偍娌℃湁鎻愪氦鐨勬潈闄�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list1 = JSON.parseArray(priSales.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list1) { + switch (dto.getStep()) { + case 0: + dto.setCurr(Boolean.FALSE); + break; + case 1: + dto.setCurr(Boolean.TRUE); + dto.setMsg(getUser().getNickname() + "鎻愪氦瀹屾垚"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + priSales.setSettleMsg(JSON.toJSONString(list1)); + // 淇敼瑙勫垝鍗曠姸鎬� + priSales.setSettle(1); + priSales.setUpdateUserId(getUserId()); + priSales.setUpdateTime(now); + priSales.setMemberId(manager1.getId()); + + if (!priSalesService.updateById(priSales)) { + throw new CoolException("鎻愪氦澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + case 1: + // 鏈儴闂ㄧ粡鐞嗗鏍� + User user = userService.selectById(priSales.getUserId()); + User manager = userService.getDeptManager(getHostId(), user.getDeptId()); + if (manager.getId().equals(getUserId())) { + + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list = JSON.parseArray(priSales.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list) { + switch (dto.getStep()) { + case 1: + dto.setCurr(Boolean.FALSE); + break; + case 2: + dto.setCurr(Boolean.TRUE); + dto.setMsg("閮ㄩ棬缁忕悊" + manager.getNickname() + "瀹℃壒閫氳繃"); + dto.setTime(DateUtils.convert(now)); + break; + default: + break; + } + } + priSales.setSettleMsg(JSON.toJSONString(list)); + + // 淇敼瑙勫垝鍗曠姸鎬� + priSales.setSettle(2); // 鐢宠閫氳繃 + priSales.setUpdateTime(now); + if (!priSalesService.updateById(priSales)) { + throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + } else { + return R.error("鎶辨瓑锛屾偍娌℃湁瀹℃牳鐨勬潈闄愶紒锛侊紒"); + } + break; + case 2: + // 涓氬姟鍛� + User salesman0 = userService.selectById(priSales.getUserId()); + if (!getUserId().equals(salesman0.getId())) { + return R.error("鎶辨瓑锛屾偍鏃犻渶纭锛侊紒锛�"); + } + // 淇敼 settle 姝ラ鏁版嵁 + List<SettleDto> list2 = JSON.parseArray(priSales.getSettleMsg(), SettleDto.class); + for (SettleDto dto : list2) { + switch (dto.getStep()) { + case 2: + dto.setCurr(Boolean.TRUE); + break; + case 3: + dto.setCurr(Boolean.TRUE); + dto.setMsg("涓氬姟鍛�" + salesman0.getNickname() + "浠ョ‘璁�"); + dto.setTime(DateUtils.convert(new Date())); + break; + default: + break; + } + } + priSales.setSettleMsg(JSON.toJSONString(list2)); + // 淇敼瑙勫垝鍗曠姸鎬� + priSales.setSettle(3); // 瀹℃壒閫氳繃 + priSales.setUpdateTime(new Date()); + + if (!priSalesService.updateById(priSales)) { + throw new CoolException("纭澶辫触锛岃鑱旂郴绠$悊鍛�"); + } + break; + default: + return R.error(); + } + return R.ok("瀹℃壒鎴愬姛"); + } + } diff --git a/src/main/java/com/zy/crm/manager/controller/ReimburseOnlineController.java b/src/main/java/com/zy/crm/manager/controller/ReimburseOnlineController.java index 62e9c28..2505934 100644 --- a/src/main/java/com/zy/crm/manager/controller/ReimburseOnlineController.java +++ b/src/main/java/com/zy/crm/manager/controller/ReimburseOnlineController.java @@ -534,7 +534,7 @@ reimburseOnline.setMemberId(manager1.getId()); if (!reimburseOnlineService.updateById(reimburseOnline)) { - throw new CoolException("瀹℃牳澶辫触锛岃鑱旂郴绠$悊鍛�"); + throw new CoolException("鎻愪氦澶辫触锛岃鑱旂郴绠$悊鍛�"); } break; case 1: diff --git a/src/main/java/com/zy/crm/manager/entity/Contract.java b/src/main/java/com/zy/crm/manager/entity/Contract.java index 22ba587..8040b03 100644 --- a/src/main/java/com/zy/crm/manager/entity/Contract.java +++ b/src/main/java/com/zy/crm/manager/entity/Contract.java @@ -185,9 +185,29 @@ @TableField("dept_id") private Long deptId; + /** + * hostId + */ + @ApiModelProperty(value= "hostId") + @TableField("host_id") + private Long hostId; + + /** + * 杩涘害 + */ + @ApiModelProperty(value= "杩涘害") + private Integer settle; + + /** + * 娴佺▼杩涘害 + */ + @ApiModelProperty(value= "娴佺▼杩涘害") + @TableField("settle_msg") + private String settleMsg; + public Contract() {} - public Contract(Long id, String customer, String address, String company, String companyAddress, String taxNum, String bank, String bankNum, Date createTime, Date updateTime, Long userId, Long updateBy, String filepath, String city, String shippingAddress, String shippingName, String shippingPhone, Double price, String email, String name, Integer status, String memo, String boss, String serial, Long deptId) { + public Contract(Long id, String customer, String address, String company, String companyAddress, String taxNum, String bank, String bankNum, Date createTime, Date updateTime, Long userId, Long updateBy, String filepath, String city, String shippingAddress, String shippingName, String shippingPhone, Double price, String email, String name, Integer status, String memo, String boss, String serial, Long deptId, Long hostId,Integer settle,String settleMsg) { this.id = id; this.customer = customer; this.address = address; @@ -213,6 +233,9 @@ this.boss = boss; this.serial = serial; this.deptId = deptId; + this.hostId = hostId; + this.settle = settle; + this.settleMsg = settleMsg; } // Contract contract = new Contract( @@ -237,6 +260,24 @@ // null // 鐢靛瓙閭 // ); + public String getSettle$(){ + if (null == this.settle){ return null; } + switch (this.settle){ + case 0: + return "绛夊緟鎻愪氦"; + case 1: + return "绛夊緟缁勯暱瀹℃壒"; + case 2: + return "绛夊緟鎬昏鍔炲鎵�"; + case 3: + return "绛夊緟纭"; + case 4: + return "瀹℃壒閫氳繃"; + default: + return String.valueOf(this.settle); + } + } + public String getCreateTime$(){ if (Cools.isEmpty(this.createTime)){ return ""; diff --git a/src/main/java/com/zy/crm/manager/entity/PriOnline2.java b/src/main/java/com/zy/crm/manager/entity/PriOnline2.java index a019030..3e17c27 100644 --- a/src/main/java/com/zy/crm/manager/entity/PriOnline2.java +++ b/src/main/java/com/zy/crm/manager/entity/PriOnline2.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.enums.IdType; import com.core.common.Cools; import com.core.common.SpringUtils; +import com.zy.crm.manager.service.CstmrService; import com.zy.crm.manager.service.PlanService; import com.zy.crm.system.entity.User; import com.zy.crm.system.service.UserService; @@ -99,13 +100,37 @@ @TableField("check_data_file") private String checkDataFile; + /** + * hostId + */ + @ApiModelProperty(value= "hostId") + @TableField("host_id") + private Long hostId; + + /** + * 杩涘害 + */ + @ApiModelProperty(value= "杩涘害") + private Integer settle; + + /** + * 娴佺▼杩涘害 + */ + @ApiModelProperty(value= "娴佺▼杩涘害") + @TableField("settle_msg") + private String settleMsg; + + @ApiModelProperty(value= "") + private String form; + public PriOnline2() {} - public PriOnline2(String title, String sheetData, Date createTime, String filepath) { + public PriOnline2(String title, String sheetData, Date createTime, String filepath,Integer settle) { this.title = title; this.sheetData = sheetData; this.createTime = createTime; this.filepath = filepath; + this.settle = settle; } // PriOnline priOnline = new PriOnline( @@ -113,6 +138,22 @@ // null, // excel琛ㄦ暟鎹� // null // 鍒涘缓鏃堕棿 // ); + + public String getSettle$(){ + if (null == this.settle){ return null; } + switch (this.settle){ + case 0: + return "绛夊緟鎻愪氦"; + case 1: + return "绛夊緟瀹℃壒"; + case 2: + return "绛夊緟纭"; + case 3: + return "瀹℃壒閫氳繃"; + default: + return String.valueOf(this.settle); + } + } public String getCreateTime$(){ if (Cools.isEmpty(this.createTime)){ @@ -137,6 +178,15 @@ // return null; // } + public Long getCstmrId$(){ + CstmrService cstmrService = SpringUtils.getBean(CstmrService.class); + Cstmr cstmr = cstmrService.selectByName(1L, this.templateName); + if (!Cools.isEmpty(cstmr)){ + return cstmr.getId(); + } + return 0L; + } + public String getPlanId$() { PlanService planService = SpringUtils.getBean(PlanService.class); Plan plan = planService.selectById(this.itemId); diff --git a/src/main/java/com/zy/crm/manager/entity/PriQuote.java b/src/main/java/com/zy/crm/manager/entity/PriQuote.java index 371577d..e9e6be8 100644 --- a/src/main/java/com/zy/crm/manager/entity/PriQuote.java +++ b/src/main/java/com/zy/crm/manager/entity/PriQuote.java @@ -6,6 +6,7 @@ import java.util.Date; import com.core.common.SpringUtils; +import com.zy.crm.manager.service.CstmrService; import com.zy.crm.manager.service.ItemService; import com.zy.crm.manager.service.PlanService; import com.zy.crm.system.entity.User; @@ -119,6 +120,10 @@ @TableField("template") private String template; + @ApiModelProperty(value= "涓婄骇id") + @TableField("ori_quote_budget_id") + private Long oriQuoteBudgetId; + public PriQuote() {} public PriQuote(String title,String sheetData,Date createTime,String filepath,Integer settle) { @@ -129,6 +134,15 @@ this.settle = settle; } + public Long getCstmrId$(){ + CstmrService cstmrService = SpringUtils.getBean(CstmrService.class); + Cstmr cstmr = cstmrService.selectByName(1L, this.templateName); + if (!Cools.isEmpty(cstmr)){ + return cstmr.getId(); + } + return 0L; + } + public String getSettle$(){ if (null == this.settle){ return null; } switch (this.settle){ diff --git a/src/main/java/com/zy/crm/manager/entity/PriQuoteBudget.java b/src/main/java/com/zy/crm/manager/entity/PriQuoteBudget.java index c6cbb8d..f362af7 100644 --- a/src/main/java/com/zy/crm/manager/entity/PriQuoteBudget.java +++ b/src/main/java/com/zy/crm/manager/entity/PriQuoteBudget.java @@ -6,6 +6,7 @@ import java.util.Date; import com.core.common.SpringUtils; +import com.zy.crm.manager.service.CstmrService; import com.zy.crm.manager.service.ItemService; import com.zy.crm.manager.service.PlanService; import com.zy.crm.system.entity.User; @@ -86,9 +87,33 @@ @TableField("member_id") private Long memberId; + @ApiModelProperty(value= "涓婄骇id") + @TableField("pri_sales_id") + private Long priSalesId; + @ApiModelProperty(value= "鍒涘缓閮ㄩ棬") @TableField("dept_id") private Long deptId; + + /** + * hostId + */ + @ApiModelProperty(value= "hostId") + @TableField("host_id") + private Long hostId; + + /** + * 杩涘害 + */ + @ApiModelProperty(value= "杩涘害") + private Integer settle; + + /** + * 娴佺▼杩涘害 + */ + @ApiModelProperty(value= "娴佺▼杩涘害") + @TableField("settle_msg") + private String settleMsg; public PriQuoteBudget() {} @@ -99,6 +124,31 @@ this.filepath = filepath; } + public String getSettle$(){ + if (null == this.settle){ return null; } + switch (this.settle){ + case 0: + return "绛夊緟鎻愪氦"; + case 1: + return "绛夊緟瀹℃壒"; + case 2: + return "绛夊緟纭"; + case 3: + return "瀹℃壒閫氳繃"; + default: + return String.valueOf(this.settle); + } + } + + public Long getCstmrId$(){ + CstmrService cstmrService = SpringUtils.getBean(CstmrService.class); + Cstmr cstmr = cstmrService.selectByName(1L, this.templateName); + if (!Cools.isEmpty(cstmr)){ + return cstmr.getId(); + } + return 0L; + } + public String getCreateTime$(){ if (Cools.isEmpty(this.createTime)){ return ""; diff --git a/src/main/java/com/zy/crm/manager/entity/PriSales.java b/src/main/java/com/zy/crm/manager/entity/PriSales.java index d548388..240f3b7 100644 --- a/src/main/java/com/zy/crm/manager/entity/PriSales.java +++ b/src/main/java/com/zy/crm/manager/entity/PriSales.java @@ -6,9 +6,7 @@ import java.util.Date; import com.core.common.SpringUtils; -import com.zy.crm.manager.service.ItemService; -import com.zy.crm.manager.service.OrderService; -import com.zy.crm.manager.service.PlanService; +import com.zy.crm.manager.service.*; import com.zy.crm.system.entity.User; import com.zy.crm.system.service.UserService; import org.springframework.format.annotation.DateTimeFormat; @@ -87,9 +85,33 @@ @TableField("in_order_num") private String inOrderNum; + @ApiModelProperty(value= "涓婄骇id") + @TableField("pri_online2_id") + private Long priOnline2Id; + @ApiModelProperty(value= "涓氬姟鍛�") @TableField("member_id") private Long memberId; + + /** + * hostId + */ + @ApiModelProperty(value= "hostId") + @TableField("host_id") + private Long hostId; + + /** + * 杩涘害 + */ + @ApiModelProperty(value= "杩涘害") + private Integer settle; + + /** + * 娴佺▼杩涘害 + */ + @ApiModelProperty(value= "娴佺▼杩涘害") + @TableField("settle_msg") + private String settleMsg; public PriSales() {} @@ -98,6 +120,31 @@ this.sheetData = sheetData; this.createTime = createTime; this.filepath = filepath; + } + + public String getSettle$(){ + if (null == this.settle){ return null; } + switch (this.settle){ + case 0: + return "绛夊緟鎻愪氦"; + case 1: + return "绛夊緟瀹℃壒"; + case 2: + return "绛夊緟纭"; + case 3: + return "瀹℃壒閫氳繃"; + default: + return String.valueOf(this.settle); + } + } + + public Long getCstmrId$(){ + CstmrService cstmrService = SpringUtils.getBean(CstmrService.class); + Cstmr cstmr = cstmrService.selectByName(1L, this.templateName); + if (!Cools.isEmpty(cstmr)){ + return cstmr.getId(); + } + return 0L; } public String getCreateTime$(){ @@ -115,6 +162,14 @@ } return null; } + public String getPriOnline2Id$() { + PriSalesService priSalesService = SpringUtils.getBean(PriSalesService.class); + PriSales priSales = priSalesService.selectById(this.priOnline2Id); + if (!Cools.isEmpty(priSales)){ + return String.valueOf(priSales.getId()); + } + return null; + } public String getUpdateTime$(){ if (Cools.isEmpty(this.updateTime)){ diff --git a/src/main/java/com/zy/crm/manager/entity/ProcessPermissions.java b/src/main/java/com/zy/crm/manager/entity/ProcessPermissions.java index f514388..4ef6362 100644 --- a/src/main/java/com/zy/crm/manager/entity/ProcessPermissions.java +++ b/src/main/java/com/zy/crm/manager/entity/ProcessPermissions.java @@ -133,6 +133,8 @@ return "鎶ラ攢娴佺▼"; case 4: return "鍑哄樊娴佺▼"; + case 7: + return "鍚堝悓绠$悊"; default: return String.valueOf(this.processMemo); } diff --git a/src/main/java/com/zy/crm/manager/entity/ReimburseOnline.java b/src/main/java/com/zy/crm/manager/entity/ReimburseOnline.java index d411a3c..a5c7538 100644 --- a/src/main/java/com/zy/crm/manager/entity/ReimburseOnline.java +++ b/src/main/java/com/zy/crm/manager/entity/ReimburseOnline.java @@ -167,6 +167,30 @@ // null // 鍒涘缓鏃堕棿 // ); + public String getSettle$(){ + if (null == this.settle){ return null; } + switch (this.settle){ + case 0: + return "寰呮彁浜�"; + case 1: + return "绛夊緟閮ㄩ棬缁忕悊瀹℃牳"; + case 2: + return "绛夊緟缁撶偣3瀹℃牳"; + case 3: + return "绛夊緟缁撶偣4瀹℃牳"; + case 4: + return "绛夊緟缁撶偣5瀹℃牳"; + case 5: + return "绛夊緟缁撶偣6瀹℃牳"; + case 6: + return "鐢宠閫氳繃"; + case 7: + return "鐢宠閫氳繃"; + default: + return String.valueOf(this.settle); + } + } + public String getCreateTime$(){ if (Cools.isEmpty(this.createTime)){ return ""; diff --git a/src/main/java/com/zy/crm/manager/service/impl/OrderServiceImpl.java b/src/main/java/com/zy/crm/manager/service/impl/OrderServiceImpl.java index a14e7aa..addf494 100644 --- a/src/main/java/com/zy/crm/manager/service/impl/OrderServiceImpl.java +++ b/src/main/java/com/zy/crm/manager/service/impl/OrderServiceImpl.java @@ -43,9 +43,9 @@ private String getNextUuid(Long hostId) { Order order = this.baseMapper.selectOrderByNewestUuid(hostId); if (order == null) { - return "0001"; + return "00001"; } - return zerofill(String.valueOf(Integer.parseInt(order.getUuid()) + 1), 4); + return zerofill(String.valueOf(Integer.parseInt(order.getUuid()) + 1), 5); } public static String zerofill(String msg, Integer count){ diff --git a/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java b/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java index 935174d..7ea271d 100644 --- a/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java +++ b/src/main/java/com/zy/crm/manager/service/impl/PlanServiceImpl.java @@ -68,9 +68,9 @@ private String getNextUuid(Long hostId) { Plan plan = this.baseMapper.selectPlanByNewestUuid(hostId); if (plan == null) { - return "0001"; + return "00001"; } - return zerofill(String.valueOf(Integer.parseInt(plan.getUuid()) + 1), 4); + return zerofill(String.valueOf(Integer.parseInt(plan.getUuid()) + 1), 5); } public static String zerofill(String msg, Integer count){ diff --git a/src/main/resources/mapper/ContractMapper.xml b/src/main/resources/mapper/ContractMapper.xml index ce0f449..1062e68 100644 --- a/src/main/resources/mapper/ContractMapper.xml +++ b/src/main/resources/mapper/ContractMapper.xml @@ -29,6 +29,9 @@ <result column="boss" property="boss" /> <result column="serial" property="serial" /> <result column="dept_id" property="deptId" /> + <result column="settle" property="settle" /> + <result column="settle_msg" property="settleMsg" /> + <result column="host_id" property="hostId" /> </resultMap> diff --git a/src/main/resources/mapper/PriOnline2Mapper.xml b/src/main/resources/mapper/PriOnline2Mapper.xml index fc609f0..a8a9239 100644 --- a/src/main/resources/mapper/PriOnline2Mapper.xml +++ b/src/main/resources/mapper/PriOnline2Mapper.xml @@ -17,6 +17,7 @@ <result column="status" property="status" /> <result column="update_time" property="updateTime" /> <result column="check_data" property="checkData" /> + <result column="settle" property="settle" /> </resultMap> <!-- 鏌ヨ缁撴灉涓嶅寘鍚玡xcel鏁版嵁data锛屼互鍏嶇粨鏋滈泦杩囧ぇ --> @@ -32,6 +33,7 @@ <result column="dept_id" property="deptId" /> <result column="status" property="status" /> <result column="update_time" property="updateTime" /> + <result column="settle" property="settle" /> </resultMap> <select id="listByPage" resultMap="NoDataResultMap"> diff --git a/src/main/resources/mapper/PriSalesMapper.xml b/src/main/resources/mapper/PriSalesMapper.xml index ae27fbc..35cc4a0 100644 --- a/src/main/resources/mapper/PriSalesMapper.xml +++ b/src/main/resources/mapper/PriSalesMapper.xml @@ -9,6 +9,7 @@ <result column="sheet_data" property="sheetData" /> <result column="create_time" property="createTime" /> <result column="dept_id" property="deptId" /> + <result column="pri_online2_id" property="priOnline2Id" /> </resultMap> diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js index fbac2a4..ec739c4 100644 --- a/src/main/webapp/static/js/common.js +++ b/src/main/webapp/static/js/common.js @@ -236,3 +236,7 @@ return(false); } var businessTripByMore; +var priOnlineByMore; +var priSalesByMore; +var priQuoteBudgetByMore; +var contractByMore; diff --git a/src/main/webapp/static/js/contract/contract.js b/src/main/webapp/static/js/contract/contract.js index dec90b0..6b25d76 100644 --- a/src/main/webapp/static/js/contract/contract.js +++ b/src/main/webapp/static/js/contract/contract.js @@ -88,11 +88,12 @@ , {field: 'status$', align: 'center', title: '鐘舵��'} , {field: 'userId$', align: 'center', title: '娣诲姞浜哄憳'} , {field: 'createTime$', align: 'center', title: '娣诲姞鏃堕棿'} + , {field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} , {field: 'updateBy$', align: 'center', title: '淇敼浜哄憳'} , {field: 'updateTime$', align: 'center', title: '淇敼鏃堕棿'} , {field: 'memo', align: 'center', title: '澶囨敞'} - , {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 400} + , {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 500} ]], request: { pageName: 'curr', @@ -193,6 +194,29 @@ table.on('tool(contract)', function (obj) { var data = obj.data; switch (obj.event) { + case 'approval': + layer.confirm('瀹℃壒閫氳繃锛�', { + skin: 'layui-layer-admin', + shade: .1, + offset: '200px', + title: data.name + }, function (i) { + layer.close(i); + approval(data.id); + }); + break; + case 'more': + top.contractByMore = data.id; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "contract_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; case 'edit': showEditModel(data); break; @@ -472,6 +496,33 @@ layDateRender(); + function approval(contractId, plannerId, dIdx) { + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/contract/approval/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + contractId: contractId, + plannerId: plannerId + }, + method: 'POST', + success: function (res) { + if (dIdx) { + layer.close(dIdx); + } + layer.close(loadIndex); + if (res.code === 200){ + layer.msg(res.msg, {icon: 1}); + tableReload(); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + } + }); // 鍏抽棴鍔ㄤ綔 diff --git a/src/main/webapp/static/js/order/order.js b/src/main/webapp/static/js/order/order.js index adb2696..c4ab073 100644 --- a/src/main/webapp/static/js/order/order.js +++ b/src/main/webapp/static/js/order/order.js @@ -2,6 +2,8 @@ var pageCount = 0; var treeCond; var admin; +var userId ; +var userName ; layui.config({ base: baseUrl + "/static/layui/lay/modules/" }).extend({ @@ -268,6 +270,7 @@ success: function (layero, dIndex) { let cstmrSel = loadCstmrSel(); let companySel = loadCompanySel(); + let method = mData?'update':'add'; if (!mData){ companySel.setValue([{name: "娴欐睙涓壃绔嬪簱鎶�鏈湁闄愬叕鍙�", value: 4}]); } @@ -277,8 +280,8 @@ if (mData.company) { companySel.setValue([{name: mData.company$, value: mData.company}]); } }else { mData = { - director: 25, - director$: "闄嗘檽娑�" + director: Number(userId), + director$: userName } } layDateRender(mData); @@ -313,11 +316,13 @@ } var loadIndex = layer.load(2); $.ajax({ - url: baseUrl+"/order/"+(mData?'update':'add')+"/auth", + url: baseUrl+"/order/"+(method)+"/auth", headers: {'token': localStorage.getItem('token')}, data: data.field, method: 'POST', success: function (res) { + console.log(data.field) + console.log(res) layer.close(loadIndex); if (res.code === 200){ layer.close(dIndex); @@ -328,6 +333,12 @@ }else { layer.msg(res.msg, {icon: 2}); } + } + ,error: function(xhr, status, error) { + // 澶勭悊閿欒 + console.log(data.field) + console.log(res) + console.log(error) } }) return false; @@ -410,6 +421,25 @@ }); } + $(document).ready(function() { + $.ajax({ + url: baseUrl + "/order/userName/userId/auth", + headers: { 'token': localStorage.getItem('token') }, + method: 'POST', + success: function(res) { + if (res.code === 200) { + userId = res.data.value; + userName = res.data.name; + } + }, + error: function(xhr, status, error) { + // 澶勭悊閿欒 + console.log(error); + } + }); + }); + + window.loadCstmrSel = function () { return xmSelect.render({ el: '#cstmrXmlSel', diff --git a/src/main/webapp/static/js/priOnline2/priOnline.js b/src/main/webapp/static/js/priOnline2/priOnline.js index 4a16343..925d0e5 100644 --- a/src/main/webapp/static/js/priOnline2/priOnline.js +++ b/src/main/webapp/static/js/priOnline2/priOnline.js @@ -84,14 +84,17 @@ cols: [[ {type: 'checkbox', fixed: 'left'} ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true} - ,{field: 'templateName', align: 'center',title: '鏍镐环鍚�',hide: false} - ,{field: 'orderNum', align: 'center',title: '鏍镐环鍗曞彿'} - ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿'} + ,{field: 'templateName', align: 'center',title: '瀹㈡埛鍚嶇О', style: 'color: #1890ff;cursor:pointer', event: 'moreCstmr', width: 350,hide: false} + ,{field: 'cstmrId$', align: 'center',title: '瀹㈡埛id',hide: true} + ,{field: 'orderNum', align: 'center',title: '鏍镐环鍗曞彿',hide: false} + ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿', style: 'color: #1890ff;cursor:pointer', event: 'morePlan',hide: false} + ,{field: 'itemId', align: 'center',title: '瑙勫垝鍗曞彿', hide: true} ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿'} ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿'} ,{field: 'status$', align: 'center',title: '鐘舵��'} ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�'} - ,{field: 'user$', align: 'center',title: '鍒涘缓浜哄憳'} + ,{field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} + // ,{field: 'user$', align: 'center',title: '鍒涘缓浜哄憳'} ,{field: 'updateUserId$', align: 'center',title: '鏇存柊浜哄憳'} ,{field: 'checkDataStatus$', align: 'center',title: '鎶ヤ环鏁版嵁'} ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:350} @@ -169,7 +172,7 @@ } else { layer.confirm('纭畾鍒犻櫎'+(ids.length===1?'姝�':ids.length)+'鏉℃暟鎹悧', function(){ $.ajax({ - url: baseUrl+"/priOnline/delete/auth", + url: baseUrl+"/priOnline2/delete/auth", headers: {'token': localStorage.getItem('token')}, data: {ids: ids}, method: 'POST', @@ -207,7 +210,7 @@ 'fields': fields }; $.ajax({ - url: baseUrl+"/priOnline/export/auth", + url: baseUrl+"/priOnline2/export/auth", headers: {'token': localStorage.getItem('token')}, data: JSON.stringify(param), dataType:'json', @@ -233,6 +236,53 @@ table.on('tool(priOnline)', function(obj){ var data = obj.data; switch (obj.event) { + case 'approval': + layer.confirm('瀹℃壒閫氳繃锛�', { + skin: 'layui-layer-admin', + shade: .1, + offset: '200px', + title: data.name + }, function (i) { + layer.close(i); + approval(data.id); + }); + break; + case 'moreCstmr': + top.cstmrByMore = data.cstmrId$; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../cstmr/cstmr_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; + case 'morePlan': + top.planByMore = data.itemId; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../plan/plan_more_other.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; + case 'more': + top.priOnlineByMore = data.id; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "priOnline_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; // 鏍镐环 case 'check': layer.open({ @@ -447,6 +497,34 @@ }); } + + function approval(priOnlineId, plannerId, dIdx) { + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/priOnline2/approval/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + priOnlineId: priOnlineId, + plannerId: plannerId + }, + method: 'POST', + success: function (res) { + if (dIdx) { + layer.close(dIdx); + } + layer.close(loadIndex); + if (res.code === 200){ + layer.msg(res.msg, {icon: 1}); + tableReload(); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + } + }); // 鍏抽棴鍔ㄤ綔 diff --git a/src/main/webapp/static/js/priQuote/priQuote.js b/src/main/webapp/static/js/priQuote/priQuote.js index b8b6563..3fcfb10 100644 --- a/src/main/webapp/static/js/priQuote/priQuote.js +++ b/src/main/webapp/static/js/priQuote/priQuote.js @@ -88,13 +88,15 @@ cellMinWidth: 150, cols: [[ {type: 'checkbox', fixed: 'left'} - ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} - ,{field: 'templateName', align: 'center',title: '妯℃澘鍚�', width: 220, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} - ,{field: 'orderNum', align: 'center',title: '鎶ヤ环棰勭畻鍗曞彿',hide: false} + ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide : true} + ,{field: 'templateName', align: 'center',title: '瀹㈡埛鍚嶇О', style: 'color: #1890ff;cursor:pointer', event: 'moreCstmr', width: 350,hide: false} + ,{field: 'cstmrId$', align: 'center',title: '瀹㈡埛id',hide: true} ,{field: 'inOrderNum', align: 'center',title: '鎶ヤ环缂栧彿',hide: false} - ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿',hide: false} + ,{field: 'orderNum', align: 'center',title: '鎶ヤ环棰勭畻鍗曞彿',hide: false} + ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿', style: 'color: #1890ff;cursor:pointer', event: 'morePlan'} + ,{field: 'itemId', align: 'center',title: '瑙勫垝鍗曞彿', hide: true} ,{field: 'planName$', align: 'center',title: '瑙勫垝鍗曞悕绉�',hide: false} - ,{field: 'settle$', align: 'center',title: '杩涘害', width: 150,hide: false} + ,{field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more', width: 150,hide: false} ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿',hide: false} ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿',hide: false} ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�',hide: false} @@ -240,6 +242,30 @@ table.on('tool(priQuote)', function(obj){ var data = obj.data; switch (obj.event) { + case 'moreCstmr': + top.cstmrByMore = data.cstmrId$; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../cstmr/cstmr_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; + case 'morePlan': + top.planByMore = data.itemId; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../plan/plan_more_other.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; case 'approval': layer.confirm('瀹℃壒閫氳繃锛�', { skin: 'layui-layer-admin', diff --git a/src/main/webapp/static/js/priQuoteBudget/priQuoteBudget.js b/src/main/webapp/static/js/priQuoteBudget/priQuoteBudget.js index f4b2b90..78dc2df 100644 --- a/src/main/webapp/static/js/priQuoteBudget/priQuoteBudget.js +++ b/src/main/webapp/static/js/priQuoteBudget/priQuoteBudget.js @@ -82,15 +82,18 @@ cellMinWidth: 150, cols: [[ {type: 'checkbox', fixed: 'left'} - ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} - ,{field: 'templateName', align: 'center',title: '妯℃澘鍚�'} - ,{field: 'orderNum', align: 'center',title: '浜у搧璐圭敤鏄庣粏鍗曞彿'} + ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide : true} + ,{field: 'templateName', align: 'center',title: '瀹㈡埛鍚嶇О', style: 'color: #1890ff;cursor:pointer', event: 'moreCstmr', width: 350,hide: false} + ,{field: 'cstmrId$', align: 'center',title: '瀹㈡埛id',hide: true} ,{field: 'inOrderNum', align: 'center',title: '棰勭畻缂栧彿'} - ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿'} + ,{field: 'orderNum', align: 'center',title: '浜у搧璐圭敤鏄庣粏鍗曞彿'} + ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿', style: 'color: #1890ff;cursor:pointer', event: 'morePlan'} + ,{field: 'itemId', align: 'center',title: '瑙勫垝鍗曞彿', hide: true} ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿'} ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿'} ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�'} - ,{field: 'userId$', align: 'center',title: '鍒涘缓浜哄憳'} + ,{field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} + // ,{field: 'userId$', align: 'center',title: '鍒涘缓浜哄憳'} ,{field: 'updateUserId$', align: 'center',title: '鏇存柊浜哄憳'} ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:200} ]], @@ -231,6 +234,53 @@ table.on('tool(priQuoteBudget)', function(obj){ var data = obj.data; switch (obj.event) { + case 'approval': + layer.confirm('瀹℃壒閫氳繃锛�', { + skin: 'layui-layer-admin', + shade: .1, + offset: '200px', + title: data.name + }, function (i) { + layer.close(i); + approval(data.id); + }); + break; + case 'more': + top.priQuoteBudgetByMore = data.id; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "priQuoteBudget_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; + case 'moreCstmr': + top.cstmrByMore = data.cstmrId$; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../cstmr/cstmr_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; + case 'morePlan': + top.planByMore = data.itemId; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../plan/plan_more_other.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; case "quoteBudget": layer.open({ type: 2, @@ -354,6 +404,33 @@ }); } + function approval(priQuoteBudgetId, plannerId, dIdx) { + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/priQuoteBudget/approval/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + priQuoteBudgetId: priQuoteBudgetId, + plannerId: plannerId + }, + method: 'POST', + success: function (res) { + if (dIdx) { + layer.close(dIdx); + } + layer.close(loadIndex); + if (res.code === 200){ + layer.msg(res.msg, {icon: 1}); + tableReload(); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + } + }); // 鍏抽棴鍔ㄤ綔 diff --git a/src/main/webapp/static/js/priSales/priSales.js b/src/main/webapp/static/js/priSales/priSales.js index 4201b0c..322ba95 100644 --- a/src/main/webapp/static/js/priSales/priSales.js +++ b/src/main/webapp/static/js/priSales/priSales.js @@ -82,15 +82,18 @@ cellMinWidth: 150, cols: [[ {type: 'checkbox', fixed: 'left'} - ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} - ,{field: 'templateName', align: 'center',title: '妯℃澘鍚�'} - ,{field: 'orderNum', align: 'center',title: '鏍镐环璁㈠崟鍙�'} + ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide : true} + ,{field: 'templateName', align: 'center',title: '瀹㈡埛鍚嶇О', style: 'color: #1890ff;cursor:pointer', event: 'moreCstmr', width: 350,hide: false} + ,{field: 'cstmrId$', align: 'center',title: '瀹㈡埛id',hide: true} ,{field: 'inOrderNum', align: 'center',title: '鏄庣粏缂栧彿'} - ,{field: 'planId$', align: 'center',title: '椤圭洰鍚�'} + ,{field: 'orderNum', align: 'center',title: '鏍镐环鍗曞彿'} + ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿', style: 'color: #1890ff;cursor:pointer', event: 'morePlan'} + ,{field: 'itemId', align: 'center',title: '瑙勫垝鍗曞彿', hide: true} ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿'} ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿'} ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�'} - ,{field: 'userId$', align: 'center',title: '鍒涘缓浜哄憳'} + ,{field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} + // ,{field: 'userId$', align: 'center',title: '鍒涘缓浜哄憳'} ,{field: 'updateUserId$', align: 'center',title: '鏇存柊浜哄憳'} ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:250} ]], @@ -231,6 +234,53 @@ table.on('tool(priSales)', function(obj){ var data = obj.data; switch (obj.event) { + case 'approval': + layer.confirm('瀹℃壒閫氳繃锛�', { + skin: 'layui-layer-admin', + shade: .1, + offset: '200px', + title: data.name + }, function (i) { + layer.close(i); + approval(data.id); + }); + break; + case 'more': + top.priSalesByMore = data.id; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "priSales_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; + case 'moreCstmr': + top.cstmrByMore = data.cstmrId$; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../cstmr/cstmr_more.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; + case 'morePlan': + top.planByMore = data.itemId; + admin.popupRight({ + type: 1, + window: "top", + area: "1250px", + url: "../plan/plan_more_other.html", + end: function () { + // $(".layui-laypage-btn")[0].click(); + } + }) + break; case "priOnline": layer.open({ type: 2, @@ -357,6 +407,33 @@ }); } + function approval(priSalesId, plannerId, dIdx) { + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/priSales/approval/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + priSalesId: priSalesId, + plannerId: plannerId + }, + method: 'POST', + success: function (res) { + if (dIdx) { + layer.close(dIdx); + } + layer.close(loadIndex); + if (res.code === 200){ + layer.msg(res.msg, {icon: 1}); + tableReload(); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + } + }); // 鍏抽棴鍔ㄤ綔 diff --git a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js index 827a3ed..476bd87 100644 --- a/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js +++ b/src/main/webapp/static/js/reimburseOnline/reimburseOnline.js @@ -87,14 +87,14 @@ {field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true} ,{field: 'templateName', align: 'center',title: '鎶ラ攢绫诲瀷',hide: false} ,{field: 'checkData', align: 'center',title: '鏄惁鍐茶处',hide: false} - ,{field: 'orderNum', align: 'center',title: '鎶ラ攢鍗曞彿',width: 320, style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} + ,{field: 'orderNum', align: 'center',title: '鎶ラ攢鍗曞彿',width: 320,hide: false} ,{field: 'planId$', align: 'center',title: '椤圭洰鍙�',hide: false} ,{field: 'name', align: 'center',title: '瀹㈡埛淇℃伅',hide: false} - ,{field: 'settle', align: 'center',title: '杩涘害',hide: false} ,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿',hide: false} ,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿',hide: false} ,{field: 'status$', align: 'center',title: '鐘舵��',hide: false} ,{field: 'memberId$', align: 'center',title: '涓氬姟鍛�',hide: false} + ,{field: 'settle$', align: 'center',title: '杩涘害', style: 'color: #1890ff;cursor:pointer', event: 'more',hide: false} ,{field: 'user$', align: 'center',title: '鍒涘缓浜哄憳',hide: false} ,{field: 'updateUserId$', align: 'center',title: '鏇存柊浜哄憳',hide: false} // // ,{field: 'checkDataStatus$', align: 'center',title: '鎶ヤ环鏁版嵁'} diff --git a/src/main/webapp/views/businessTrip/businessTrip.html b/src/main/webapp/views/businessTrip/businessTrip.html index b7596f2..3add1a7 100644 --- a/src/main/webapp/views/businessTrip/businessTrip.html +++ b/src/main/webapp/views/businessTrip/businessTrip.html @@ -72,7 +72,7 @@ <script type="text/html" id="toolbar"> <div class="layui-btn-container"> - <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button> + <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鍑哄樊鐢宠</button> <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">鍒犻櫎</button> <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">瀵煎嚭</button> </div> @@ -81,7 +81,7 @@ <script type="text/html" id="operate"> {{# if (d.settle == 1) { }} <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">瀹℃壒</a> - <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a> {{# } }} <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> </script> @@ -273,7 +273,7 @@ <div style="height: 10%"> <hr class="layui-bg-gray"> <div class="layui-form-item text-right" style="padding-right: 30px"> - <button class="layui-btn" lay-filter="editSubmit" lay-submit="">淇濆瓨</button> + <button class="layui-btn" lay-filter="editSubmit" lay-submit="">鎻愪氦</button> <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button> </div> </div> diff --git a/src/main/webapp/views/contract/contract.html b/src/main/webapp/views/contract/contract.html index db5f93a..8ef9e96 100644 --- a/src/main/webapp/views/contract/contract.html +++ b/src/main/webapp/views/contract/contract.html @@ -71,17 +71,29 @@ </script> <script type="text/html" id="operate"> - <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a> + {{# if (d.settle == 0) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">鎻愪氦</a> + {{# } }} + {{# if (d.settle == 1) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">瀹℃壒</a> + {{# } }} + {{# if (d.settle == 2) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">纭</a> + {{# } }} + {{# if (d.settle == 0 || d.settle == 1) { }} + <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a> + {{# } }} <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="sales">鍚堝悓鏄庣粏</a> <a class="layui-btn layui-btn-xs btn-edit" lay-event="generate">鐢熸垚鍚堝悓</a> <a class="layui-btn layui-btn-xs btn-edit" lay-event="upload">涓婁紶鍚堝悓</a> <a class="layui-btn layui-btn-xs btn-edit" lay-event="download">涓嬭浇</a> - <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> </script> <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> +<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/contract/contract.js" charset="utf-8"></script> </body> diff --git a/src/main/webapp/views/contract/contract_more.html b/src/main/webapp/views/contract/contract_more.html new file mode 100644 index 0000000..7095b3c --- /dev/null +++ b/src/main/webapp/views/contract/contract_more.html @@ -0,0 +1,187 @@ +<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> +<style> + #formAdvForm { + background-color: #f3f3f3; + } + #formAdvForm .layui-form-item { + margin-top: 20px; + margin-bottom: 0; + } + + #formAdvForm .layui-form-item .layui-inline { + margin-bottom: 25px; + margin-right: 0; + } + + .form-group-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + padding: 10px 20px; + background-color: #fff; + box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05); + } +</style> +<!-- 姝f枃寮�濮� --> +<form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%"> + <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box"> + <!-- 鏍囬 --> + <div class="layui-card"> + <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px"> + <div> + <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold"></i> + <span id="form-name" style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span> + <span style="opacity: .5;font-size: small;margin-left: 5px">鏍镐环鍗�</span> + </div> + </div> + <div class="layui-card-body" style="padding: 30px 20px"> + + <div class="layui-tab layui-steps"> + <ul class="layui-tab-title" id="stepBox"> + </ul> + </div> + + </div> + </div> + <div class="layui-row"> + <!-- 鏁版嵁 --> + <!-- <div class="layui-col-md9">--> + <!-- <div class="layui-card">--> + <!-- <div class="layui-card-header">--> + <!-- 鍩烘湰淇℃伅--> + <!-- </div>--> + <!-- <div class="layui-card-body">--> + + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- 鍔ㄦ�� --> + <!-- <div class="layui-col-md3" style="width: 24%;margin-left: 1%">--> + <div class="layui-col-md3" style="width: 100%;"> + <!-- 鏃堕棿绾� --> + <div class="layui-card"> + <div class="layui-card-header"> + <span>娴佺▼鍔ㄦ��</span> + </div> + <div class="layui-card-body"> + <ul class="layui-timeline" id="timelineBox"> + </ul> + </div> + </div> + </div> + </div> + </div> + + <div class="form-group-bottom text-right"> + <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 鍒锋柊 </button> + </div> + +</form> + +<script type="text/html" id="followerTabOperate"> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> +</script> + +<script type="text/template" id="stepTpl"> + {{#each list}} + <li id="step-{{step}}" style="pointer-events: none"> + <i class="layui-icon layui-icon-ok">{{step}}</i> + <span class="layui-steps-title">{{title}}</span> + {{# if username}} + <span class="layui-steps-content">{{username}}</span> + {{ else }} + <span class="layui-steps-content"> </span> + {{/if}} + </li> + {{/each}} +</script> + +<script type="text/template" id="timelineTpl"> + {{#each list}} + <li class="layui-timeline-item"> + <i class="layui-icon layui-timeline-axis"></i> + <div class="layui-timeline-content layui-text"> + <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4> + <span>{{time}}</span> + <p> + {{msg}} + </p> + </div> + </li> + {{/each}} +</script> + +<script> + var contractId = top.contractByMore; + $('.layui-layer-close').hide(); + layui.config({ + base: baseUrl + "/static/layui/lay/modules/" + }).extend({ + notice: 'notice/notice', + steps: 'steps/steps', + }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () { + var $ = layui.jquery; + var form = layui.form; + var table = layui.table; + var laydate = layui.laydate; + var notice = layui.notice; + var xmSelect = layui.xmSelect; + var steps = layui.steps; + + form.render('select'); + + init(); + function init(){ + notice.msg('姝e湪杞藉叆鏁版嵁......', {icon: 4, position: "topRight"}); + $.ajax({ + url: baseUrl + "/contract/" + contractId + "/auth", + headers: {'token': localStorage.getItem('token')}, + method: 'GET', + success: function (res) { + notice.destroy(); + if (res.code === 200) { + let contract = res.data; + top.contractByMore = null; + $("#form-name").html(contract.name); + // 杩涘害姝ラ鍥� + let template0 = Handlebars.compile($('#stepTpl').html()); + $('#stepBox').html(template0({list: JSON.parse(contract.settleMsg)})); + $('#step-' + Number(contract.step)).addClass("layui-this"); + + let template1 = Handlebars.compile($('#timelineTpl').html()); + $('#timelineBox').html(template1({list: JSON.parse(contract.settleMsg)})); + // 琛ュ厖html + $('#customizeBox').html(contract.formHtml); + // 璁惧鏄庣粏 + // form.val('formAdvForm', contract); + // top.convertDisabled($('#formAdvForm :input'), true); + // 璺熻繘浜� + // initFollowers(contract.id); + layDateRender(); + } else if (res.code === 403) { + top.location.href = baseUrl + "/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + } + + /* 娓叉煋laydate */ + function layDateRender() { + laydate.render({ + elem: '#endTime', + type: 'datetime' + }); + } + layDateRender(); + + /* 鐩戝惉琛ㄥ崟鎻愪氦 */ + form.on('submit(refresh)', function (data) { + init(); + return false; + }); + + }) +</script> diff --git a/src/main/webapp/views/plan/plan_more_other.html b/src/main/webapp/views/plan/plan_more_other.html new file mode 100644 index 0000000..97420cb --- /dev/null +++ b/src/main/webapp/views/plan/plan_more_other.html @@ -0,0 +1,511 @@ +<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> +<style> + #formAdvForm { + background-color: #f3f3f3; + } + #formAdvForm .layui-form-item { + margin-top: 20px; + margin-bottom: 0; + } + + #formAdvForm .layui-form-item .layui-inline { + margin-bottom: 25px; + margin-right: 0; + } + + .form-group-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + padding: 10px 20px; + background-color: #fff; + box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05); + } + + .card-body-item { + display: inline-block; + border-right: 1px solid #e0e0e0; + width: 250px; + padding: 0 30px 0 10px; + } + .header-desc { + overflow:hidden; + white-space: nowrap; + text-overflow: ellipsis; + -o-text-overflow:ellipsis; + } + +</style> +<!-- 姝f枃寮�濮� --> +<form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%"> + <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box"> + <!-- 鏍囬 --> + <div class="layui-card"> + <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px"> + <div> + <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold"></i> + <span id="form-name" style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span> + <span style="opacity: .5;font-size: small;margin-left: 5px">鍞墠瑙勫垝鐢宠鍗�</span> + </div> + </div> +<!-- <div class="layui-card-body" style="padding: 30px 20px">--> + +<!-- <div class="layui-tab layui-steps">--> +<!-- <ul class="layui-tab-title" id="stepBox">--> +<!-- </ul>--> +<!-- </div>--> + +<!-- </div>--> + </div> + <div class="layui-row"> + <!-- 鏁版嵁 --> + <div class="layui-col-md12"> + <div class="layui-card"> + <div class="layui-card-header"> + 鍩烘湰淇℃伅 + </div> + <div class="layui-card-body"> + + <!-- 鍩烘湰淇℃伅 --> + <div class="layui-form-item layui-row"> + <input name="id" type="hidden" /> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">瑙勫垝鍗曞彿:</label> + <div class="layui-input-block"> + <input name="uuid" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">鐢宠鏃ユ湡 :</label> + <div class="layui-input-block"> + <input name="appleTime$" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">璺熻釜椤圭洰:</label> + <div class="layui-input-block"> + <input name="orderId$" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">瀹㈡埛鍚嶇О:</label> + <div class="layui-input-block"> + <input name="cstmrId$" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">涓氬姟鍛�:</label> + <div class="layui-input-block"> + <input name="userId$" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">瀹℃壒鐘舵��:</label> + <div class="layui-input-block"> + <input name="settle$" class="layui-input" disabled/> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">涓氬姟绫诲瀷:</label> + <div class="layui-input-block"> + <input name="planType$" class="layui-input" disabled /> + </div> + </div> + </div> + + <!-- 鍏朵粬 --> + <div class="layui-form-item layui-row"> + <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"> + <legend style="font-size: 13px">鍏朵粬</legend> + </fieldset> + <div id="customizeBox" class="formDes"> + </div> + </div> + + <!-- 鍞墠瑙勫垝 --> + <div class="layui-form-item layui-row"> + <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"> + <legend style="font-size: 13px">鍞墠瑙勫垝</legend> + </fieldset> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">瑙勫垝鍛�:</label> + <div class="layui-input-block"> + <input name="planner" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">瀹屾垚鏃堕棿:</label> + <div class="layui-input-block"> + <input name="finishTime$" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">鏇存敼鏂规:</label> + <div class="layui-input-block"> + <input name="change" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">鏇存敼娆℃暟:</label> + <div class="layui-input-block"> + <input name="changeTime" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">鏇存敼鍘熷洜:</label> + <div class="layui-input-block"> + <input name="changeReason" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">瑙勬牸濂栭噾:</label> + <div class="layui-input-block"> + <input name="planBonus" class="layui-input" disabled /> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">缁勯暱濂栭噾:</label> + <div class="layui-input-block"> + <input name="planLeaderBonus" class="layui-input" disabled /> + </div> + </div> + </div> + + <!-- 绯荤粺淇℃伅 --> + <div class="layui-form-item layui-row"> + <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;"> + <legend style="font-size: 13px">绯荤粺淇℃伅</legend> + </fieldset> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">娣诲姞浜哄憳:</label> + <div class="layui-input-block"> + <input name="createBy$" class="layui-input" disabled/> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">淇敼浜哄憳:</label> + <div class="layui-input-block"> + <input name="updateBy$" class="layui-input" disabled/> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">娣诲姞鏃堕棿:</label> + <div class="layui-input-block"> + <input name="createTime$" class="layui-input icon-date" autocomplete="off" disabled/> + </div> + </div> + <div class="layui-inline layui-col-md6"> + <label class="layui-form-label">淇敼鏃堕棿:</label> + <div class="layui-input-block"> + <input name="updateTime$" class="layui-input icon-date" autocomplete="off" disabled/> + </div> + </div> + </div> + + </div> + </div> + </div> + <!-- 鍔ㄦ�� --> +<!-- <div class="layui-col-md3" style="width: 24%;margin-left: 1%">--> + <!-- 鏃堕棿绾� --> +<!-- <div class="layui-card">--> +<!-- <div class="layui-card-header">--> +<!-- <span>鍞墠瑙勫垝娓呭崟</span>--> +<!-- </div>--> +<!-- <div class="layui-card-body">--> +<!-- <ul class="layui-timeline" id="timelineBox">--> +<!-- </ul>--> +<!-- </div>--> +<!-- </div>--> + <!-- 璺熻繘浜� --> +<!-- <div class="layui-card">--> +<!-- <div class="layui-card-header">--> +<!-- <span>璺熻繘浜�</span>--> +<!-- <span lay-filter="followerAdd" lay-submit style="float: right;cursor: pointer;">--> +<!-- <i class="layui-icon" style="font-size: 20px;color: #1890ff;"></i>--> +<!-- </span>--> +<!-- </div>--> +<!-- <div class="layui-card-body">--> +<!-- <table id="followersTable" lay-filter="followersTable"></table>--> +<!-- </div>--> +<!-- </div>--> +<!-- </div>--> + </div> + </div> + + <div class="form-group-bottom text-right"> + <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 鍒锋柊 </button> + </div> + +</form> + +<script type="text/html" id="followerTabOperate"> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> +</script> + +<!-- 璺熻繘浜� --> +<script type="text/html" id="followerEditDialog"> + <form id="followerEditForm" lay-filter="followerEditForm" class="layui-form model-form"> + <input name="experimentId" type="hidden"/> + <div class="layui-form-item" style="float: left;clear: none;margin-right: 20px"> + <label class="layui-form-label">閫夋嫨鎴愬憳</label> + <div class="layui-input-block"> + <div id="followersBox" name="followersBox"> + </div> + </div> + </div> + <div class="layui-form-item text-right" style="float: left;clear: none"> + <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button> + <button class="layui-btn" lay-filter="followerSubmit" lay-submit>淇濆瓨</button> + </div> + </form> +</script> + +<script type="text/template" id="stepTpl"> + {{#each list}} + <li id="step-{{step}}" style="pointer-events: none"> + <i class="layui-icon layui-icon-ok">{{step}}</i> + <span class="layui-steps-title">{{title}}</span> + {{# if username}} + <span class="layui-steps-content">{{username}}</span> + {{ else }} + <span class="layui-steps-content"> </span> + {{/if}} + </li> + {{/each}} +</script> + +<script type="text/template" id="timelineTpl"> + {{#each list}} + <li class="layui-timeline-item"> + <i class="layui-icon layui-timeline-axis"></i> + <div class="layui-timeline-content layui-text"> + <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4> + <span>{{time}}</span> + <p> + {{msg}} + </p> + </div> + </li> + {{/each}} +</script> + +<script> + var planId = top.planByMore; + $('.layui-layer-close').hide(); + layui.config({ + base: baseUrl + "/static/layui/lay/modules/" + }).extend({ + notice: 'notice/notice', + steps: 'steps/steps', + }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () { + var $ = layui.jquery; + var form = layui.form; + var table = layui.table; + var laydate = layui.laydate; + var notice = layui.notice; + var xmSelect = layui.xmSelect; + var steps = layui.steps; + + form.render('select'); + + init(); + function init(){ + notice.msg('姝e湪杞藉叆鏁版嵁......', {icon: 4, position: "topRight"}); + $.ajax({ + url: baseUrl + "/plan/" + planId + "/auth", + headers: {'token': localStorage.getItem('token')}, + method: 'GET', + success: function (res) { + notice.destroy(); + if (res.code === 200) { + let plan = res.data; + top.planByMore = null; + $("#form-name").html(plan.name); + // 杩涘害姝ラ鍥� + let template0 = Handlebars.compile($('#stepTpl').html()); + $('#stepBox').html(template0({list: JSON.parse(plan.settleMsg)})); + $('#step-' + Number(plan.step)).addClass("layui-this"); + + let template1 = Handlebars.compile($('#timelineTpl').html()); + $('#timelineBox').html(template1({list: JSON.parse(plan.settleMsg)})); + // 琛ュ厖html + $('#customizeBox').html(plan.formHtml); + // 璁惧鏄庣粏 + form.val('formAdvForm', plan); + top.convertDisabled($('#formAdvForm :input'), true); + // 璺熻繘浜� + // initFollowers(plan.id); + layDateRender(); + } else if (res.code === 403) { + top.location.href = baseUrl + "/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + } + + /* 娓叉煋laydate */ + function layDateRender() { + laydate.render({ + elem: '#endTime', + type: 'datetime' + }); + } + layDateRender(); + + // 娓叉煋璺熻繘浜烘ā鍧� + function initFollowers(planId) { + if (!planId) { + return; + } + $.ajax({ + url: baseUrl+"/plan/followers/table/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + planId: planId + }, + method: 'GET', + success: function (res) { + if (res.code === 200){ + var follTab = table.render({ + elem: '#followersTable', + data: res.data, + limit: 999, + height: 'full-408', + cols: [[ + {field: 'userName', title: '宸ヤ綔浜哄憳'}, + {fixed: 'right', title:'', align: 'center', toolbar: '#followerTabOperate', width: 70} + ]], + done: function (res, curr, count) { + $('#dictTable+.layui-table-view .layui-table-body tbody>tr:first').trigger('click'); + } + }); + // 鐩戝惉琛屽伐鍏蜂簨浠� + table.on('tool(followersTable)', function(obj){ + let data = obj.data; + switch (obj.event) { + case "del": + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/plan/followers/remove/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + planId: planId, + userId: data.userId + }, + method: 'POST', + success: function (res) { + layer.close(loadIndex); + if (res.code === 200){ + initFollowers(planId); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + } else { + layer.msg(res.msg, {icon: 2}); + } + } + }) + break; + } + }); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + }else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + } + + // 娣诲姞璺熻繘浜� + var followerLayer; + form.on('submit(followerAdd)', function (data) { + if (followerLayer) {return;} + followerLayer = admin.open({ + type: 1, + offset: '150px', + area: '600px', + title: '娣诲姞璺熻繘浜�', + content: $('#followerEditDialog').html(), + success: function (layero, dIndex) { + // 琛ㄥ崟鎻愪氦浜嬩欢 + form.on('submit(followerSubmit)', function (data) { + let selectList = xmSelectIdx.getValue(); + if (selectList.length === 0) { + layer.msg("璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�", {icon: 3}); + return false; + } + let loadIndex = layer.load(2); + $.ajax({ + url: baseUrl+"/plan/followers/add/auth", + headers: {'token': localStorage.getItem('token')}, + data: { + planId: planId, + followerIds: selectList.map(function (d) { + return d.value; + }) + }, + method: 'POST', + success: function (res) { + if (res.code === 200){ + layer.close(loadIndex); + initFollowers(planId); + } else if (res.code === 403){ + top.location.href = baseUrl+"/"; + }else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + layer.close(dIndex); + return false; + }); + let xmSelectIdx = xmSelect.render({ + el: '#followersBox', + style: { + width: '280px', + }, + autoRow: true, + toolbar: { show: true }, + filterable: true, + remoteSearch: true, + remoteMethod: function(val, cb, show){ + $.ajax({ + url: baseUrl+"/user/all/get/kv", + headers: {'token': localStorage.getItem('token')}, + data: { + condition: val + }, + method: 'POST', + success: function (res) { + if (res.code === 200){ + cb(res.data) + } else { + cb([]); + layer.msg(res.msg, {icon: 2}); + } + } + }); + } + }) + // 寮圭獥涓嶅嚭鐜版粴鍔ㄦ潯 + $(layero).children('.layui-layer-content').css('overflow', 'visible'); + layui.form.render('select'); + }, + end: function () { + followerLayer = null; + } + }) + }); + + /* 鐩戝惉琛ㄥ崟鎻愪氦 */ + form.on('submit(refresh)', function (data) { + init(); + return false; + }); + + }) +</script> diff --git a/src/main/webapp/views/priOnline2/priOnline.html b/src/main/webapp/views/priOnline2/priOnline.html index 0cdbf0a..1014318 100644 --- a/src/main/webapp/views/priOnline2/priOnline.html +++ b/src/main/webapp/views/priOnline2/priOnline.html @@ -73,11 +73,22 @@ <script type="text/html" id="operate"> + {{# if (d.settle == 0) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">鎻愪氦</a> + {{# } }} + {{# if (d.settle == 1) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">瀹℃壒</a> + {{# } }} + {{# if (d.settle == 2) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">纭</a> + {{# } }} + {{# if (d.settle == 0 || d.settle == 1) { }} + <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> + {{# } }} <a class="layui-btn layui-btn-xs btn-edit" lay-event="check">鏍镐环</a> <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a> <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="upload">涓婁紶璇环</a> <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="viewCheck">鏌ョ湅璇环</a> - <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> </script> <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> @@ -85,6 +96,7 @@ <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/luckysheet_js/luckyexcel.umd.js"></script> +<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> <script type="text/javascript" src="../../static/js/luckysheet_js/pako.es5.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/luckysheet_js/base64.min.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/priOnline2/priOnline.js" charset="utf-8"></script> diff --git a/src/main/webapp/views/priOnline2/priOnline_more.html b/src/main/webapp/views/priOnline2/priOnline_more.html new file mode 100644 index 0000000..cc8f88b --- /dev/null +++ b/src/main/webapp/views/priOnline2/priOnline_more.html @@ -0,0 +1,187 @@ +<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> +<style> + #formAdvForm { + background-color: #f3f3f3; + } + #formAdvForm .layui-form-item { + margin-top: 20px; + margin-bottom: 0; + } + + #formAdvForm .layui-form-item .layui-inline { + margin-bottom: 25px; + margin-right: 0; + } + + .form-group-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + padding: 10px 20px; + background-color: #fff; + box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05); + } +</style> +<!-- 姝f枃寮�濮� --> +<form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%"> + <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box"> + <!-- 鏍囬 --> + <div class="layui-card"> + <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px"> + <div> + <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold"></i> + <span id="form-name" style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span> + <span style="opacity: .5;font-size: small;margin-left: 5px">鏍镐环鍗�</span> + </div> + </div> + <div class="layui-card-body" style="padding: 30px 20px"> + + <div class="layui-tab layui-steps"> + <ul class="layui-tab-title" id="stepBox"> + </ul> + </div> + + </div> + </div> + <div class="layui-row"> + <!-- 鏁版嵁 --> + <!-- <div class="layui-col-md9">--> + <!-- <div class="layui-card">--> + <!-- <div class="layui-card-header">--> + <!-- 鍩烘湰淇℃伅--> + <!-- </div>--> + <!-- <div class="layui-card-body">--> + + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- 鍔ㄦ�� --> + <!-- <div class="layui-col-md3" style="width: 24%;margin-left: 1%">--> + <div class="layui-col-md3" style="width: 100%;"> + <!-- 鏃堕棿绾� --> + <div class="layui-card"> + <div class="layui-card-header"> + <span>娴佺▼鍔ㄦ��</span> + </div> + <div class="layui-card-body"> + <ul class="layui-timeline" id="timelineBox"> + </ul> + </div> + </div> + </div> + </div> + </div> + + <div class="form-group-bottom text-right"> + <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 鍒锋柊 </button> + </div> + +</form> + +<script type="text/html" id="followerTabOperate"> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> +</script> + +<script type="text/template" id="stepTpl"> + {{#each list}} + <li id="step-{{step}}" style="pointer-events: none"> + <i class="layui-icon layui-icon-ok">{{step}}</i> + <span class="layui-steps-title">{{title}}</span> + {{# if username}} + <span class="layui-steps-content">{{username}}</span> + {{ else }} + <span class="layui-steps-content"> </span> + {{/if}} + </li> + {{/each}} +</script> + +<script type="text/template" id="timelineTpl"> + {{#each list}} + <li class="layui-timeline-item"> + <i class="layui-icon layui-timeline-axis"></i> + <div class="layui-timeline-content layui-text"> + <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4> + <span>{{time}}</span> + <p> + {{msg}} + </p> + </div> + </li> + {{/each}} +</script> + +<script> + var priOnlineId = top.priOnlineByMore; + $('.layui-layer-close').hide(); + layui.config({ + base: baseUrl + "/static/layui/lay/modules/" + }).extend({ + notice: 'notice/notice', + steps: 'steps/steps', + }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () { + var $ = layui.jquery; + var form = layui.form; + var table = layui.table; + var laydate = layui.laydate; + var notice = layui.notice; + var xmSelect = layui.xmSelect; + var steps = layui.steps; + + form.render('select'); + + init(); + function init(){ + notice.msg('姝e湪杞藉叆鏁版嵁......', {icon: 4, position: "topRight"}); + $.ajax({ + url: baseUrl + "/priOnline2/" + priOnlineId + "/auth", + headers: {'token': localStorage.getItem('token')}, + method: 'GET', + success: function (res) { + notice.destroy(); + if (res.code === 200) { + let priOnline = res.data; + top.priOnlineByMore = null; + $("#form-name").html(priOnline.name); + // 杩涘害姝ラ鍥� + let template0 = Handlebars.compile($('#stepTpl').html()); + $('#stepBox').html(template0({list: JSON.parse(priOnline.settleMsg)})); + $('#step-' + Number(priOnline.step)).addClass("layui-this"); + + let template1 = Handlebars.compile($('#timelineTpl').html()); + $('#timelineBox').html(template1({list: JSON.parse(priOnline.settleMsg)})); + // 琛ュ厖html + $('#customizeBox').html(priOnline.formHtml); + // 璁惧鏄庣粏 + // form.val('formAdvForm', priOnline); + // top.convertDisabled($('#formAdvForm :input'), true); + // 璺熻繘浜� + // initFollowers(priOnline.id); + layDateRender(); + } else if (res.code === 403) { + top.location.href = baseUrl + "/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + } + + /* 娓叉煋laydate */ + function layDateRender() { + laydate.render({ + elem: '#endTime', + type: 'datetime' + }); + } + layDateRender(); + + /* 鐩戝惉琛ㄥ崟鎻愪氦 */ + form.on('submit(refresh)', function (data) { + init(); + return false; + }); + + }) +</script> diff --git a/src/main/webapp/views/priQuoteBudget/priQuoteBudget.html b/src/main/webapp/views/priQuoteBudget/priQuoteBudget.html index fd0c7b6..9b61072 100644 --- a/src/main/webapp/views/priQuoteBudget/priQuoteBudget.html +++ b/src/main/webapp/views/priQuoteBudget/priQuoteBudget.html @@ -9,6 +9,8 @@ <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> <link rel="stylesheet" href="../../static/css/cool.css" media="all"> + <link rel="stylesheet" href="../../static/layui/lay/modules/formDesigner/coolForm.css" /> + <link rel="stylesheet" href="../../static/css/tree.css" media="all"> <style> .nav-box { position: absolute; @@ -98,15 +100,27 @@ </script> <script type="text/html" id="operate"> + {{# if (d.settle == 0) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">鎻愪氦</a> + {{# } }} + {{# if (d.settle == 1) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">瀹℃壒</a> + {{# } }} + {{# if (d.settle == 2) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">纭</a> + {{# } }} + {{# if (d.settle == 0 || d.settle == 1) { }} + <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a> + {{# } }} <a class="layui-btn layui-btn-xs btn-edit" lay-event="quoteBudget">鎶ヤ环棰勭畻</a> - <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a> - <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> </script> <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> +<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> <script type="text/javascript" src="../../static/js/priQuoteBudget/priQuoteBudget.js" charset="utf-8"></script> <!-- 琛ㄥ崟寮圭獥 --> <script type="text/html" id="editDialog"> @@ -127,12 +141,12 @@ </div> </div> - <div class="layui-form-item"> - <label class="layui-form-label">椤圭洰鍚�: </label> - <div class="layui-input-block"> - <input class="layui-input" id="planId" disabled placeholder="璇疯緭鍏ラ」鐩悕" autocomplete="off" lay-verify="required"> - </div> - </div> +<!-- <div class="layui-form-item">--> +<!-- <label class="layui-form-label">椤圭洰鍚�: </label>--> +<!-- <div class="layui-input-block">--> +<!-- <input class="layui-input" name="name" disabled placeholder="璇疯緭鍏ラ」鐩悕" autocomplete="off" lay-verify="required">--> +<!-- </div>--> +<!-- </div>--> <div class="layui-form-item"> <label class="layui-form-label">鏍镐环鍗曞彿: </label> diff --git a/src/main/webapp/views/priQuoteBudget/priQuoteBudget_more.html b/src/main/webapp/views/priQuoteBudget/priQuoteBudget_more.html new file mode 100644 index 0000000..7e116c6 --- /dev/null +++ b/src/main/webapp/views/priQuoteBudget/priQuoteBudget_more.html @@ -0,0 +1,187 @@ +<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> +<style> + #formAdvForm { + background-color: #f3f3f3; + } + #formAdvForm .layui-form-item { + margin-top: 20px; + margin-bottom: 0; + } + + #formAdvForm .layui-form-item .layui-inline { + margin-bottom: 25px; + margin-right: 0; + } + + .form-group-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + padding: 10px 20px; + background-color: #fff; + box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05); + } +</style> +<!-- 姝f枃寮�濮� --> +<form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%"> + <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box"> + <!-- 鏍囬 --> + <div class="layui-card"> + <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px"> + <div> + <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold"></i> + <span id="form-name" style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span> + <span style="opacity: .5;font-size: small;margin-left: 5px">鏍镐环鍗�</span> + </div> + </div> + <div class="layui-card-body" style="padding: 30px 20px"> + + <div class="layui-tab layui-steps"> + <ul class="layui-tab-title" id="stepBox"> + </ul> + </div> + + </div> + </div> + <div class="layui-row"> + <!-- 鏁版嵁 --> + <!-- <div class="layui-col-md9">--> + <!-- <div class="layui-card">--> + <!-- <div class="layui-card-header">--> + <!-- 鍩烘湰淇℃伅--> + <!-- </div>--> + <!-- <div class="layui-card-body">--> + + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- 鍔ㄦ�� --> + <!-- <div class="layui-col-md3" style="width: 24%;margin-left: 1%">--> + <div class="layui-col-md3" style="width: 100%;"> + <!-- 鏃堕棿绾� --> + <div class="layui-card"> + <div class="layui-card-header"> + <span>娴佺▼鍔ㄦ��</span> + </div> + <div class="layui-card-body"> + <ul class="layui-timeline" id="timelineBox"> + </ul> + </div> + </div> + </div> + </div> + </div> + + <div class="form-group-bottom text-right"> + <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 鍒锋柊 </button> + </div> + +</form> + +<script type="text/html" id="followerTabOperate"> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> +</script> + +<script type="text/template" id="stepTpl"> + {{#each list}} + <li id="step-{{step}}" style="pointer-events: none"> + <i class="layui-icon layui-icon-ok">{{step}}</i> + <span class="layui-steps-title">{{title}}</span> + {{# if username}} + <span class="layui-steps-content">{{username}}</span> + {{ else }} + <span class="layui-steps-content"> </span> + {{/if}} + </li> + {{/each}} +</script> + +<script type="text/template" id="timelineTpl"> + {{#each list}} + <li class="layui-timeline-item"> + <i class="layui-icon layui-timeline-axis"></i> + <div class="layui-timeline-content layui-text"> + <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4> + <span>{{time}}</span> + <p> + {{msg}} + </p> + </div> + </li> + {{/each}} +</script> + +<script> + var priQuoteBudgetId = top.priQuoteBudgetByMore; + $('.layui-layer-close').hide(); + layui.config({ + base: baseUrl + "/static/layui/lay/modules/" + }).extend({ + notice: 'notice/notice', + steps: 'steps/steps', + }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () { + var $ = layui.jquery; + var form = layui.form; + var table = layui.table; + var laydate = layui.laydate; + var notice = layui.notice; + var xmSelect = layui.xmSelect; + var steps = layui.steps; + + form.render('select'); + + init(); + function init(){ + notice.msg('姝e湪杞藉叆鏁版嵁......', {icon: 4, position: "topRight"}); + $.ajax({ + url: baseUrl + "/priQuoteBudget/" + priQuoteBudgetId + "/auth", + headers: {'token': localStorage.getItem('token')}, + method: 'GET', + success: function (res) { + notice.destroy(); + if (res.code === 200) { + let priQuoteBudget = res.data; + top.priQuoteBudgetByMore = null; + $("#form-name").html(priQuoteBudget.name); + // 杩涘害姝ラ鍥� + let template0 = Handlebars.compile($('#stepTpl').html()); + $('#stepBox').html(template0({list: JSON.parse(priQuoteBudget.settleMsg)})); + $('#step-' + Number(priQuoteBudget.step)).addClass("layui-this"); + + let template1 = Handlebars.compile($('#timelineTpl').html()); + $('#timelineBox').html(template1({list: JSON.parse(priQuoteBudget.settleMsg)})); + // 琛ュ厖html + $('#customizeBox').html(priQuoteBudget.formHtml); + // 璁惧鏄庣粏 + // form.val('formAdvForm', priQuoteBudget); + // top.convertDisabled($('#formAdvForm :input'), true); + // 璺熻繘浜� + // initFollowers(priQuoteBudget.id); + layDateRender(); + } else if (res.code === 403) { + top.location.href = baseUrl + "/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + } + + /* 娓叉煋laydate */ + function layDateRender() { + laydate.render({ + elem: '#endTime', + type: 'datetime' + }); + } + layDateRender(); + + /* 鐩戝惉琛ㄥ崟鎻愪氦 */ + form.on('submit(refresh)', function (data) { + init(); + return false; + }); + + }) +</script> diff --git a/src/main/webapp/views/priSales/priSales.html b/src/main/webapp/views/priSales/priSales.html index ea98625..9e567d1 100644 --- a/src/main/webapp/views/priSales/priSales.html +++ b/src/main/webapp/views/priSales/priSales.html @@ -9,6 +9,8 @@ <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all"> <link rel="stylesheet" href="../../static/css/cool.css" media="all"> + <link rel="stylesheet" href="../../static/layui/lay/modules/formDesigner/coolForm.css" /> + <link rel="stylesheet" href="../../static/css/tree.css" media="all"> <style> .nav-box { position: absolute; @@ -98,14 +100,26 @@ </script> <script type="text/html" id="operate"> - <a class="layui-btn layui-btn-xs btn-edit" lay-event="priOnline">浜у搧璐圭敤鏄庣粏</a> - <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a> + {{# if (d.settle == 0) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">鎻愪氦</a> + {{# } }} + {{# if (d.settle == 1) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">瀹℃壒</a> + {{# } }} + {{# if (d.settle == 2) { }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">纭</a> + {{# } }} + {{# if (d.settle == 0 || d.settle == 1) { }} <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">缂栬緫</a> + {{# } }} + <a class="layui-btn layui-btn-xs btn-edit" lay-event="priOnline">浜у搧璐圭敤鏄庣粏</a> </script> <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> +<script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> <script type="text/javascript" src="../../static/js/priSales/priSales.js" charset="utf-8"></script> <!-- 琛ㄥ崟寮圭獥 --> @@ -115,24 +129,30 @@ <div class="layui-row"> <div class="layui-col-md12"> <div class="layui-form-item"> - <label class="layui-form-label layui-form-required">璁㈠崟鍙�: </label> + <label class="layui-form-label layui-form-required">鏍镐环鍗曞彿: </label> <div class="layui-input-block cool-auto-complete"> - <input class="layui-input" name="id" placeholder="璇疯緭鍏ヨ鍗曞彿" style="display: none" lay-verify="required"> - <input id="orderNum" name="orderNum" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="璇疯緭鍏ヨ鍗曞彿" onfocus=this.blur()> + <input class="layui-input" name="id" placeholder="璇疯緭鍏ユ牳浠峰崟鍙�" style="display: none" lay-verify="required"> + <input id="orderNum" name="orderNum" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="璇疯緭鍏ユ牳浠峰崟鍙�" onfocus=this.blur()> <div class="cool-auto-complete-window"> - <input class="cool-auto-complete-window-input" data-key="priOnlineQueryBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> - <select class="cool-auto-complete-window-select" data-key="priOnlineQueryBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'),getItemInfo)" multiple="multiple"> + <input class="cool-auto-complete-window-input" data-key="priOnline2QueryBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> + <select class="cool-auto-complete-window-select" data-key="priOnline2QueryBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'),getItemInfo)" multiple="multiple"> </select> </div> </div> </div> - <div class="layui-form-item"> - <label class="layui-form-label">椤圭洰鍚�: </label> - <div class="layui-input-block"> - <input class="layui-input" id="planId" disabled placeholder="璇疯緭鍏ラ」鐩悕" autocomplete="off" lay-verify="required"> - </div> - </div> +<!-- <div class="layui-form-item">--> +<!-- <label class="layui-form-label">椤圭洰鍚�: </label>--> +<!-- <div class="layui-input-block">--> +<!-- <input class="layui-input" id="planId" disabled placeholder="璇疯緭鍏ラ」鐩悕" autocomplete="off" lay-verify="required">--> +<!-- </div>--> +<!-- </div>--> +<!-- <div class="layui-form-item">--> +<!-- <label class="layui-form-label layui-form-required">椤圭洰鍚�: </label>--> +<!-- <div class="layui-input-block">--> +<!-- <input class="layui-input" id="planId" type="text" name="planId" placeholder="璇疯緭鍏ラ」鐩悕" autocomplete="off">--> +<!-- </div>--> +<!-- </div>--> </div> </div> diff --git a/src/main/webapp/views/priSales/priSales_more.html b/src/main/webapp/views/priSales/priSales_more.html new file mode 100644 index 0000000..596169f --- /dev/null +++ b/src/main/webapp/views/priSales/priSales_more.html @@ -0,0 +1,187 @@ +<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> +<style> + #formAdvForm { + background-color: #f3f3f3; + } + #formAdvForm .layui-form-item { + margin-top: 20px; + margin-bottom: 0; + } + + #formAdvForm .layui-form-item .layui-inline { + margin-bottom: 25px; + margin-right: 0; + } + + .form-group-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + padding: 10px 20px; + background-color: #fff; + box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, .05); + } +</style> +<!-- 姝f枃寮�濮� --> +<form class="layui-form" id="formAdvForm" lay-filter="formAdvForm" style="height: 100%"> + <div class="layui-fluid" style="padding-bottom: 75px;height: 100%; overflow: scroll;box-sizing: border-box"> + <!-- 鏍囬 --> + <div class="layui-card"> + <div class="layui-card-header" style="padding-top: 5px; padding-bottom: 5px"> + <div> + <i class="layui-icon" style="font-size: 20px;color: #1890ff;font-weight: bold"></i> + <span id="form-name" style="margin: 0 6px;font-size: 18px;font-weight: bold;letter-spacing: 1px"></span> + <span style="opacity: .5;font-size: small;margin-left: 5px">鏍镐环鍗�</span> + </div> + </div> + <div class="layui-card-body" style="padding: 30px 20px"> + + <div class="layui-tab layui-steps"> + <ul class="layui-tab-title" id="stepBox"> + </ul> + </div> + + </div> + </div> + <div class="layui-row"> + <!-- 鏁版嵁 --> + <!-- <div class="layui-col-md9">--> + <!-- <div class="layui-card">--> + <!-- <div class="layui-card-header">--> + <!-- 鍩烘湰淇℃伅--> + <!-- </div>--> + <!-- <div class="layui-card-body">--> + + <!-- </div>--> + <!-- </div>--> + <!-- </div>--> + <!-- 鍔ㄦ�� --> + <!-- <div class="layui-col-md3" style="width: 24%;margin-left: 1%">--> + <div class="layui-col-md3" style="width: 100%;"> + <!-- 鏃堕棿绾� --> + <div class="layui-card"> + <div class="layui-card-header"> + <span>娴佺▼鍔ㄦ��</span> + </div> + <div class="layui-card-body"> + <ul class="layui-timeline" id="timelineBox"> + </ul> + </div> + </div> + </div> + </div> + </div> + + <div class="form-group-bottom text-right"> + <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 鍒锋柊 </button> + </div> + +</form> + +<script type="text/html" id="followerTabOperate"> + <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a> +</script> + +<script type="text/template" id="stepTpl"> + {{#each list}} + <li id="step-{{step}}" style="pointer-events: none"> + <i class="layui-icon layui-icon-ok">{{step}}</i> + <span class="layui-steps-title">{{title}}</span> + {{# if username}} + <span class="layui-steps-content">{{username}}</span> + {{ else }} + <span class="layui-steps-content"> </span> + {{/if}} + </li> + {{/each}} +</script> + +<script type="text/template" id="timelineTpl"> + {{#each list}} + <li class="layui-timeline-item"> + <i class="layui-icon layui-timeline-axis"></i> + <div class="layui-timeline-content layui-text"> + <h4 class="layui-timeline-title" style="display: inline;margin-right: 10px;">{{title}}</h4> + <span>{{time}}</span> + <p> + {{msg}} + </p> + </div> + </li> + {{/each}} +</script> + +<script> + var priSalesId = top.priSalesByMore; + $('.layui-layer-close').hide(); + layui.config({ + base: baseUrl + "/static/layui/lay/modules/" + }).extend({ + notice: 'notice/notice', + steps: 'steps/steps', + }).use(['form', 'table', 'laydate', 'notice', 'xmSelect', 'steps'], function () { + var $ = layui.jquery; + var form = layui.form; + var table = layui.table; + var laydate = layui.laydate; + var notice = layui.notice; + var xmSelect = layui.xmSelect; + var steps = layui.steps; + + form.render('select'); + + init(); + function init(){ + notice.msg('姝e湪杞藉叆鏁版嵁......', {icon: 4, position: "topRight"}); + $.ajax({ + url: baseUrl + "/priSales/" + priSalesId + "/auth", + headers: {'token': localStorage.getItem('token')}, + method: 'GET', + success: function (res) { + notice.destroy(); + if (res.code === 200) { + let priSales = res.data; + top.priSalesByMore = null; + $("#form-name").html(priSales.name); + // 杩涘害姝ラ鍥� + let template0 = Handlebars.compile($('#stepTpl').html()); + $('#stepBox').html(template0({list: JSON.parse(priSales.settleMsg)})); + $('#step-' + Number(priSales.step)).addClass("layui-this"); + + let template1 = Handlebars.compile($('#timelineTpl').html()); + $('#timelineBox').html(template1({list: JSON.parse(priSales.settleMsg)})); + // 琛ュ厖html + $('#customizeBox').html(priSales.formHtml); + // 璁惧鏄庣粏 + // form.val('formAdvForm', priSales); + // top.convertDisabled($('#formAdvForm :input'), true); + // 璺熻繘浜� + // initFollowers(priSales.id); + layDateRender(); + } else if (res.code === 403) { + top.location.href = baseUrl + "/"; + } else { + layer.msg(res.msg, {icon: 2}) + } + } + }) + } + + /* 娓叉煋laydate */ + function layDateRender() { + laydate.render({ + elem: '#endTime', + type: 'datetime' + }); + } + layDateRender(); + + /* 鐩戝惉琛ㄥ崟鎻愪氦 */ + form.on('submit(refresh)', function (data) { + init(); + return false; + }); + + }) +</script> diff --git a/src/main/webapp/views/processPermissions/processPermissions.html b/src/main/webapp/views/processPermissions/processPermissions.html index 63c634b..42c52b5 100644 --- a/src/main/webapp/views/processPermissions/processPermissions.html +++ b/src/main/webapp/views/processPermissions/processPermissions.html @@ -32,7 +32,7 @@ <option value="2">鎶ヤ环娴佺▼</option> <option value="3">鎶ラ攢娴佺▼</option> <!-- <option value="4">鍑哄樊娴佺▼</option>--> -<!-- <option value="5">鍚堝悓瀹℃壒</option>--> + <option value="7">鍚堝悓绠$悊</option> </select> </div> </div> @@ -158,34 +158,35 @@ <!-- <input class="layui-input" name="standby6" placeholder="璇疯緭鍏ュ鐢ㄥ瓧娈�6">--> <!-- </div>--> <!-- </div>--> -<!-- <div class="layui-form-item">--> -<!-- <label class="layui-form-label layui-form-required">鏉冮檺绫诲瀷: </label>--> -<!-- <div class="layui-input-block">--> -<!-- <select name="processMemo" lay-vertype="tips" lay-verify="required">--> -<!-- <option value="">璇烽�夋嫨鐘舵��</option>--> -<!-- <option value="1">鏍镐环娴佺▼</option>--> -<!-- <option value="2">鎶ヤ环娴佺▼</option>--> -<!-- <option value="3">鎶ラ攢娴佺▼</option>--> -<!-- <option value="4">鍑哄樊娴佺▼</option>--> -<!-- </select>--> -<!-- </div>--> -<!-- </div>--> -<!-- <div class="layui-form-item">--> -<!-- <label class="layui-form-label layui-form-required">鏉冮檺鑺傜偣: </label>--> -<!-- <div class="layui-input-block">--> -<!-- <select name="process" lay-vertype="tips" lay-verify="required">--> -<!-- <option value="">璇烽�夋嫨鐘舵��</option>--> -<!-- <option value="1-1">1-1</option>--> -<!-- <option value="2-1">2-1</option>--> -<!-- <option value="3-1">3-1</option>--> -<!-- <option value="3-2">3-2</option>--> -<!-- <option value="4-1">4-1</option>--> -<!-- <option value="5-1">5-1</option>--> -<!-- <option value="6-1">6-1</option>--> -<!-- <option value="7-1">7-1</option>--> -<!-- </select>--> -<!-- </div>--> -<!-- </div>--> + <div class="layui-form-item"> + <label class="layui-form-label layui-form-required">鏉冮檺绫诲瀷: </label> + <div class="layui-input-block"> + <select name="processMemo" lay-vertype="tips" lay-verify="required"> + <option value="">璇烽�夋嫨鐘舵��</option> + <option value="1">鏍镐环娴佺▼</option> + <option value="2">鎶ヤ环娴佺▼</option> + <option value="3">鎶ラ攢娴佺▼</option> + <option value="4">鍑哄樊娴佺▼</option> + <option value="7">鍚堝悓绠$悊</option> + </select> + </div> + </div> + <div class="layui-form-item"> + <label class="layui-form-label layui-form-required">鏉冮檺鑺傜偣: </label> + <div class="layui-input-block"> + <select name="process" lay-vertype="tips" lay-verify="required"> + <option value="">璇烽�夋嫨鐘舵��</option> + <option value="1-1">1-1</option> + <option value="2-1">2-1</option> + <option value="3-1">3-1</option> + <option value="3-2">3-2</option> + <option value="4-1">4-1</option> + <option value="5-1">5-1</option> + <option value="6-1">6-1</option> + <option value="7-1">7-1</option> + </select> + </div> + </div> <div class="layui-form-item"> <label class="layui-form-label">澶囨敞: </label> <div class="layui-input-block"> -- Gitblit v1.9.1