|  |  | 
 |  |  |  | 
 |  |  |     private Boolean curr; | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> init(Plan plan, User manager,User planLeader) { | 
 |  |  |     public static List<SettleDto> InItFlowPath(List<User> users, List<String> names, int nodes) { | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |         for (int i = 0; i < nodes; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  |             dto.setStep(i); | 
 |  |  |             if (i == 0) { | 
 |  |  |                 dto.setTitle("开始"); | 
 |  |  |                 dto.setMsg(users.get(i).getUsername() + names.get(i)); | 
 |  |  |                 dto.setTime(DateUtils.convert(new Date())); | 
 |  |  |                 dto.setCurr(Boolean.TRUE); | 
 |  |  |             } else { | 
 |  |  |                 dto.setTitle(names.get(i)); | 
 |  |  |             } | 
 |  |  |             dto.setUserId(users.get(i).getId()); | 
 |  |  |             dto.setUsername(users.get(i).getUsername()); | 
 |  |  |             list.add(dto); | 
 |  |  |         } | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> init(Plan plan, User manager, User planLeader) { | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |         for (int i = 1; i < 6; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  | 
 |  |  |                     dto.setCurr(Boolean.TRUE); | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  | //                case 2: | 
 |  |  | //                    dto.setTitle("组长审核"); | 
 |  |  | //                    dto.setUserId(manager.getId()); | 
 |  |  | //                    dto.setUsername(manager.getNickname()); | 
 |  |  | //                    list.add(dto); | 
 |  |  | //                    break; | 
 |  |  |                 case 2: | 
 |  |  |                     dto.setTitle("售前审核"); | 
 |  |  |                     dto.setUserId(planLeader.getId()); | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> initPriQuote(Plan plan, User manager ,User president,User user) { | 
 |  |  |     public static List<SettleDto> initPriQuote(Plan plan, User manager, User president, User user) { | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |         for (int i = 1; i < 5; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  | 
 |  |  |                     dto.setUsername(president.getNickname()); | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  | //                case 4: | 
 |  |  | //                    dto.setTitle("业务员审核"); | 
 |  |  | //                    list.add(dto); | 
 |  |  | //                    break; | 
 |  |  |                 case 4: | 
 |  |  |                     dto.setTitle("审批通过"); | 
 |  |  |                     dto.setUserId(plan.getUserId()); | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> initPriQuote(ReimburseOnline reimburseOnline, User manager , User president3, User president4,User president5,User president6,User user) { | 
 |  |  |     public static List<SettleDto> initPriQuote(ReimburseOnline reimburseOnline, User manager, User president3, User president4, User president5, User president6, User user) { | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |         for (int i = 0; i < 7; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  |             dto.setStep(i); | 
 |  |  |             switch (i) { | 
 |  |  | //                case 0: | 
 |  |  | //                    dto.setTitle("开始"); | 
 |  |  | //                    dto.setMsg(user.getUsername() + "创建了审批"); | 
 |  |  | //                    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("开始"); | 
 |  |  |                     dto.setMsg(user.getUsername() + "创建了审批"); | 
 |  |  | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  |                 case 3: | 
 |  |  |                     dto.setTitle(president3.getUsername()+"审核"); | 
 |  |  |                     dto.setTitle(president3.getUsername() + "审核"); | 
 |  |  |                     dto.setUserId(president3.getId()); | 
 |  |  |                     dto.setUsername(president3.getNickname()); | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  |                 case 4: | 
 |  |  |                     dto.setTitle(president4.getUsername()+"审核"); | 
 |  |  |                     dto.setTitle(president4.getUsername() + "审核"); | 
 |  |  |                     dto.setUserId(president4.getId()); | 
 |  |  |                     dto.setUsername(president4.getNickname()); | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  |                 case 5: | 
 |  |  |                     dto.setTitle(president5.getUsername()+"审核"); | 
 |  |  |                     dto.setTitle(president5.getUsername() + "审核"); | 
 |  |  |                     dto.setUserId(president5.getId()); | 
 |  |  |                     dto.setUsername(president5.getNickname()); | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  |                 case 6: | 
 |  |  |                     dto.setTitle(president6.getUsername()+"审核"); | 
 |  |  |                     dto.setTitle(president6.getUsername() + "审核"); | 
 |  |  |                     dto.setUserId(president6.getId()); | 
 |  |  |                     dto.setUsername(president6.getNickname()); | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  | //                case 4: | 
 |  |  | //                    dto.setTitle("业务员审核"); | 
 |  |  | //                    list.add(dto); | 
 |  |  | //                    break; | 
 |  |  |                 default: | 
 |  |  |                     break; | 
 |  |  |             } | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> initBusiness(User manager ,User user) { | 
 |  |  |     public static List<SettleDto> initBusiness(User manager, User user) { | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |         for (int i = 0; i < 3; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  | 
 |  |  |                     dto.setTitle("提交出差"); | 
 |  |  |                     dto.setUserId(user.getId()); | 
 |  |  |                     dto.setUsername(user.getNickname()); | 
 |  |  |                     dto.setMsg(user.getNickname()+"提交出差申请"); | 
 |  |  |                     dto.setMsg(user.getNickname() + "提交出差申请"); | 
 |  |  |                     dto.setTime(DateUtils.convert(new Date())); | 
 |  |  |                     list.add(dto); | 
 |  |  |                     break; | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> initSalesPricing(User manager ,User user,User userUp,List<String> names ,int nodes) { | 
 |  |  |     public static List<SettleDto> initSalesPricing(User manager, User user, User userUp, List<String> names, int nodes) { | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |         for (int i = 0; i < nodes+1; i++) { | 
 |  |  |         for (int i = 0; i < nodes + 1; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  |             dto.setStep(i); | 
 |  |  |             switch (i) { | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> initSalesPricingPriOnline2(User user,User userUp,List<String> names ,int nodes) { | 
 |  |  |     public static List<SettleDto> initSalesPricingPriOnline2(User user, User userUp, List<String> names, int nodes) { | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |         for (int i = 0; i < nodes+1; i++) { | 
 |  |  |         for (int i = 0; i < nodes + 1; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  |             dto.setStep(i); | 
 |  |  |             switch (i) { | 
 |  |  | 
 |  |  |         return list; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public static List<SettleDto> initContract(User manager ,User user,User president,List<String> names ,int nodes) { | 
 |  |  |     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++) { | 
 |  |  |         for (int i = 0; i < nodes + 1; i++) { | 
 |  |  |             SettleDto dto = new SettleDto(); | 
 |  |  |             dto.setStep(i); | 
 |  |  |             switch (i) { | 
 
 |  |  | 
 |  |  |     private ProcessPermissionsService processPermissionsService; | 
 |  |  |  | 
 |  |  |     String PZH=" ————————————————— "; | 
 |  |  |     Integer PBN = 6; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @GetMapping(value = "/plan/{id}/auth") | 
 |  |  | 
 |  |  |         wrapper.like("name", condition); | 
 |  |  |         wrapper.eq("status",1); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         ProcessPermissions processPermissions1 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "1-1"));//2:核价流程 | 
 |  |  |         User manager1 = userService.selectById(processPermissions1.getUserId());       // 获取核价流程节点1确认人 | 
 |  |  |  | 
 |  |  |         ProcessPermissions processPermissions2 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "1-2"));//2:核价流程 | 
 |  |  |         User manager2 = userService.selectById(processPermissions2.getUserId());       // 获取核价流程节点1确认人 | 
 |  |  |  | 
 |  |  |         ProcessPermissions processPermissions3= processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "1-3"));//2:核价流程 | 
 |  |  |         User manager3 = userService.selectById(processPermissions3.getUserId());       // 获取核价流程节点1确认人 | 
 |  |  |  | 
 |  |  |         List<ProcessPermissions> processPermissionsList = processPermissionsService.selectList(new EntityWrapper<ProcessPermissions>().eq("process_memo", 4).or().eq("process_memo", 5));//2:核价流程 | 
 |  |  |         int type =0; | 
 |  |  |         if (getUserId().equals(manager1.getId())){ | 
 |  |  |             type=1;//(货架) | 
 |  |  |         }else if (getUserId().equals(manager2.getId()) || getUserId().equals(manager3.getId())){ | 
 |  |  |             type = 2;//(集成) | 
 |  |  |         }else { | 
 |  |  |         for (ProcessPermissions processPermissions:processPermissionsList){ | 
 |  |  |             if (getUserId().equals(processPermissions.getUserId())){ | 
 |  |  |                 type=PBN-processPermissions.getProcessMemo(); | 
 |  |  |                 break; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         if (type==0){ | 
 |  |  |             return R.error("你不是核价员,无权接任务"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         List<Long> typeList = new ArrayList<>(); | 
 |  |  |         List<PlanType> planTypes = planTypeService.selectList(new EntityWrapper<PlanType>().eq("type", type)); | 
 |  |  |         if (type==1){ | 
 |  |  |             planTypes = planTypeService.selectList(new EntityWrapper<PlanType>()); | 
 |  |  |         } | 
 |  |  |         if (Cools.isEmpty(planTypes) || planTypes.size()==0){ | 
 |  |  |             return R.ok(); | 
 |  |  |         } | 
 
 |  |  | 
 |  |  |     private PlanService planService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private  PlanTypeService planTypeService; | 
 |  |  |     private PlanTypeService planTypeService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ProcessPermissionsService processPermissionsService; | 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private UserService userService; | 
 |  |  |  | 
 |  |  |     String PZH=" ———————————————————————————————————————————————————————————————————————————————— "; | 
 |  |  |     String PZH = " ———————————————————————————————————————————————————————————————————————————————— "; | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/priOnline2/{id}/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  | 
 |  |  |         assert priOnline2 != null; | 
 |  |  |         JSONObject resultObj = JSON.parseObject(JSON.toJSONString(priOnline2)); | 
 |  |  |         // 步骤条相关 | 
 |  |  |         resultObj.put("step", priOnline2.getSettle() == 3 ? 0 : priOnline2.getSettle() + 1); | 
 |  |  |         resultObj.put("step", priOnline2.getSettle().equals(priOnline2.getSettleSize()) ? 0 : priOnline2.getSettle() + 1); | 
 |  |  |         return R.ok().add(resultObj); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/priOnline2/list/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R list(@RequestParam(defaultValue = "1")Integer curr, | 
 |  |  |                   @RequestParam(defaultValue = "10")Integer limit, | 
 |  |  |                   @RequestParam(required = false)String orderByField, | 
 |  |  |                   @RequestParam(required = false)String orderByType, | 
 |  |  |                   @RequestParam(required = false)String condition, | 
 |  |  |                   @RequestParam Map<String, Object> param){ | 
 |  |  |     public R list(@RequestParam(defaultValue = "1") Integer curr, | 
 |  |  |                   @RequestParam(defaultValue = "10") Integer limit, | 
 |  |  |                   @RequestParam(required = false) String orderByField, | 
 |  |  |                   @RequestParam(required = false) String orderByType, | 
 |  |  |                   @RequestParam(required = false) String condition, | 
 |  |  |                   @RequestParam Map<String, Object> param) { | 
 |  |  |         EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>(); | 
 |  |  |         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.setSqlSelect("id,title,create_time as createTime,filepath,settle,settle_size as settleSize,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); | 
 |  |  |         allLike(PriOnline2.class, param.keySet(), wrapper, condition); | 
 |  |  |         wrapper.or().eq("member_id",getUserId()); | 
 |  |  |         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} | 
 |  |  |         wrapper.or().eq("member_id", getUserId()); | 
 |  |  |         if (!Cools.isEmpty(orderByField)) { | 
 |  |  |             wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); | 
 |  |  |         } | 
 |  |  |         return R.ok(priOnline2Service.selectPage(new Page<>(curr, limit), wrapper)); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ | 
 |  |  |     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")){ | 
 |  |  |         for (Map.Entry<String, Object> entry : map.entrySet()) { | 
 |  |  |             if (entry.getKey().equals("dept_id")) { | 
 |  |  |                 signDeptId = true; | 
 |  |  |                 if (String.valueOf(entry.getValue()).equals("19")){ | 
 |  |  |                 if (String.valueOf(entry.getValue()).equals("19")) { | 
 |  |  |                     signHostId = true; | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         for (Map.Entry<String, Object> entry : map.entrySet()){ | 
 |  |  |         for (Map.Entry<String, Object> entry : map.entrySet()) { | 
 |  |  |             String val = String.valueOf(entry.getValue()); | 
 |  |  |             if (val.contains(RANGE_TIME_LINK)){ | 
 |  |  |             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")){ | 
 |  |  |             } else if (entry.getKey().equals("dept_id")) { | 
 |  |  |                 if (!val.equals("19")) { | 
 |  |  |                     wrapper.eq(entry.getKey(), val); | 
 |  |  |                 } | 
 |  |  |             } else if (entry.getKey().equals("user_id") && !signDeptId){ | 
 |  |  |             } else if (entry.getKey().equals("user_id") && !signDeptId) { | 
 |  |  |                 signUserId = true; | 
 |  |  |                 wrapper.eq(entry.getKey(), val); | 
 |  |  |             } else { | 
 |  |  |                 wrapper.like(entry.getKey(), val); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         if (!signUserId && !signDeptId){ | 
 |  |  |             if (getRole().getId()==1){ | 
 |  |  |                 wrapper.or().eq("host_id",1); | 
 |  |  |             }else if (getRole().getId()==2){ | 
 |  |  |                 wrapper.eq("dept_id",getDeptId()); | 
 |  |  |             }else { | 
 |  |  |         if (!signUserId && !signDeptId) { | 
 |  |  |             if (getRole().getId() == 1) { | 
 |  |  |                 wrapper.or().eq("host_id", 1); | 
 |  |  |             } else if (getRole().getId() == 2) { | 
 |  |  |                 wrapper.eq("dept_id", getDeptId()); | 
 |  |  |             } else { | 
 |  |  |                 wrapper.eq("user_id", getUserId()); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         if (signHostId){ | 
 |  |  |             wrapper.or().eq("host_id",1); | 
 |  |  |         if (signHostId) { | 
 |  |  |             wrapper.or().eq("host_id", 1); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/priOnline2/add/auth") | 
 |  |  |     @ManagerAuth(memo = "添加核价管理") | 
 |  |  |     public R add(@RequestBody Map<String,Object> map) { | 
 |  |  |     public R add(@RequestBody Map<String, Object> map) { | 
 |  |  |         PriOnline2 priOnline2 = new PriOnline2(); | 
 |  |  |         priOnline2.setCreateTime(new Date()); | 
 |  |  |         priOnline2.setTitle(map.get("title").toString()); | 
 |  |  | 
 |  |  |         //状态,未完成 | 
 |  |  |         priOnline2.setStatus(0); | 
 |  |  |  | 
 |  |  |         if (plan.getStatus()!=1){ | 
 |  |  |         if (plan.getStatus() != 1) { | 
 |  |  |             return R.error("此规划单状态改变,请刷新页面重新选择!"); | 
 |  |  |         } | 
 |  |  |         priOnline2.setMemberId(getUserId()); | 
 |  |  | 
 |  |  | //        } | 
 |  |  |  | 
 |  |  | //        String node="2-"; | 
 |  |  | //        PlanType planType = planTypeService.selectById(plan.getPlanType()); | 
 |  |  |         PlanType planType = planTypeService.selectById(plan.getPlanType()); | 
 |  |  | //        node = node+planType.getType(); | 
 |  |  | //        ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", node));//2:核价流程 | 
 |  |  | //        ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "2-1"));//2:核价流程 | 
 |  |  | //        User manager = userService.selectById(processPermissions.getUserId());       // 获取核价流程节点2确认人 | 
 |  |  |  | 
 |  |  |                                 // 获取业务员 | 
 |  |  |         // 获取业务员 | 
 |  |  |         List<String> initNames = new ArrayList<>(); | 
 |  |  |         initNames.add("接取核价任务"); | 
 |  |  |         initNames.add("完成核价"); | 
 |  |  |         if (planType.getType().equals(2)) { | 
 |  |  |             initNames.add("完成核价"); | 
 |  |  |         } | 
 |  |  | //        initNames.add("经理审核"); | 
 |  |  |         initNames.add("业务员确认"); | 
 |  |  |         priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.initSalesPricingPriOnline2(getUser(),userUp,initNames,2))); | 
 |  |  |         List<User> users = new ArrayList<>(); | 
 |  |  |         users.add(getUser()); | 
 |  |  |         users.add(getUser()); | 
 |  |  |         if (planType.getType().equals(2)) { | 
 |  |  |             users.add(userService.selectById(73)); | 
 |  |  |         } | 
 |  |  |         users.add(userUp); | 
 |  |  |         priOnline2.setSettleMsg(JSON.toJSONString(SettleDto.InItFlowPath(users, initNames, users.size()))); | 
 |  |  |         priOnline2.setSettleSize(users.size()); | 
 |  |  |  | 
 |  |  |         //设置项目流程 | 
 |  |  |         plan.setStep(2); | 
 |  |  | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/priOnline2/addOther/auth") | 
 |  |  |     @ManagerAuth(memo = "另存核价管理") | 
 |  |  |     public R addOther(@RequestBody Map<String,Object> map) { | 
 |  |  |     public R addOther(@RequestBody Map<String, Object> map) { | 
 |  |  |         PriOnline2 online = priOnline2Service.selectById(Long.parseLong(map.get("id").toString())); | 
 |  |  |  | 
 |  |  |         PriOnline2 priOnline2 = new PriOnline2(); | 
 |  |  | 
 |  |  |         return R.ok(); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/priOnline2/update/auth") | 
 |  |  |     @ManagerAuth(memo = "更新核价管理") | 
 |  |  |     public R update(@RequestBody Map<String,Object> map){ | 
 |  |  |     @RequestMapping(value = "/priOnline2/update/auth") | 
 |  |  |     @ManagerAuth(memo = "更新核价管理") | 
 |  |  |     public R update(@RequestBody Map<String, Object> map) { | 
 |  |  |         PriOnline2 priOnline2 = priOnline2Service.selectById(Long.parseLong(map.get("id").toString())); | 
 |  |  |         if (priOnline2.getStatus() == 1) { | 
 |  |  |             return R.error("核价已完成,禁止保存"); | 
 |  |  | 
 |  |  |     //更新状态 | 
 |  |  |     @RequestMapping(value = "/priOnline2/updateForm/auth") | 
 |  |  |     @ManagerAuth(memo = "更新核价管理状态") | 
 |  |  |     public R updateForm(Long id,Integer status,String title,String templateName){ | 
 |  |  |     public R updateForm(Long id, Integer status, String title, String templateName) { | 
 |  |  |         PriOnline2 priOnline2 = priOnline2Service.selectById(id); | 
 |  |  |         priOnline2.setStatus(status); | 
 |  |  |         priOnline2.setUpdateTime(new Date()); | 
 |  |  | 
 |  |  |     @ManagerAuth(memo = "上传询价文件") | 
 |  |  |     public R uploadCheck(@RequestParam("id") Integer id, | 
 |  |  |                          @RequestParam("checkData") String checkData, | 
 |  |  |                          @RequestParam("file") MultipartFile[] files){ | 
 |  |  |                          @RequestParam("file") MultipartFile[] files) { | 
 |  |  |         PriOnline2 priOnline2 = priOnline2Service.selectById(id); | 
 |  |  |         if (priOnline2.getStatus() == 1) { | 
 |  |  |             return R.error("核价已完成,禁止上传"); | 
 |  |  | 
 |  |  |  | 
 |  |  |         MultipartFile file = files[0]; | 
 |  |  |         SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd_HHmmss"); | 
 |  |  |         String path =  ClassUtils.getDefaultClassLoader().getResource("excel/uploadCheckData").getPath(); | 
 |  |  |         String path = ClassUtils.getDefaultClassLoader().getResource("excel/uploadCheckData").getPath(); | 
 |  |  |         //文件后缀名 | 
 |  |  |         String suffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); | 
 |  |  |         //上传文件名 | 
 |  |  | 
 |  |  |  | 
 |  |  |         //服务器端保存的文件对象 | 
 |  |  |         File serverFile = new File(filepath); | 
 |  |  |         if(!serverFile.exists()) { | 
 |  |  |         if (!serverFile.exists()) { | 
 |  |  |             try { | 
 |  |  |                 //创建文件 | 
 |  |  |                 serverFile.createNewFile(); | 
 |  |  | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/priOnline2/delete/auth") | 
 |  |  |     @ManagerAuth(memo = "删除核价管理") | 
 |  |  |     public R delete(Long[] ids){ | 
 |  |  |         try{ | 
 |  |  |             if (Cools.isEmpty(ids) || ids.length==0){ | 
 |  |  |     public R delete(Long[] ids) { | 
 |  |  |         try { | 
 |  |  |             if (Cools.isEmpty(ids) || ids.length == 0) { | 
 |  |  |                 return R.error(); | 
 |  |  |             } | 
 |  |  |             for (Long id : ids){ | 
 |  |  |                 int  priQuote= priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("pri_online_id", id)); | 
 |  |  |                 if (priQuote!=0){ | 
 |  |  |             for (Long id : ids) { | 
 |  |  |                 int priQuote = priQuoteService.selectCount(new EntityWrapper<PriQuote>().eq("pri_online_id", id)); | 
 |  |  |                 if (priQuote != 0) { | 
 |  |  |                     return R.error("存在关联的报价单,禁止删除!!!"); | 
 |  |  |                 } | 
 |  |  | //                int priSales = priSalesService.selectCount(new EntityWrapper<PriSales>().eq("pri_online2_id", id)); | 
 |  |  | 
 |  |  |  | 
 |  |  |             priOnline2Service.deleteBatchIds(Arrays.asList(ids)); | 
 |  |  |             return R.ok(); | 
 |  |  |         }catch (Exception e){ | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             return R.error(e.getMessage()); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @RequestMapping(value = "/priOnline2/export/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R export(@RequestBody JSONObject param){ | 
 |  |  |     public R export(@RequestBody JSONObject param) { | 
 |  |  |         EntityWrapper<PriOnline2> wrapper = new EntityWrapper<>(); | 
 |  |  |         List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); | 
 |  |  |         Map<String, Object> map = excludeTrash(param.getJSONObject("priOnline")); | 
 |  |  | 
 |  |  |         wrapper.in("user_id", getUserRoleBelongsToUserId("allopen")); | 
 |  |  |         Page<PriOnline2> page = priOnline2Service.selectPage(new Page<>(0, 10), wrapper); | 
 |  |  |         List<Map<String, Object>> result = new ArrayList<>(); | 
 |  |  |         for (PriOnline2 priOnline2 : page.getRecords()){ | 
 |  |  |         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$()); | 
 |  |  | 
 |  |  |         wrapper.in("user_id", getUserRoleBelongsToUserId("allopen")); | 
 |  |  |         Page<PriOnline2> page = priOnline2Service.selectPage(new Page<>(0, 10), wrapper); | 
 |  |  |         List<Map<String, Object>> result = new ArrayList<>(); | 
 |  |  |         for (PriOnline2 priOnline2 : page.getRecords()){ | 
 |  |  |         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$()); | 
 |  |  | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R query(@RequestBody JSONObject param) { | 
 |  |  |         Wrapper<PriOnline2> wrapper = new EntityWrapper<PriOnline2>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); | 
 |  |  |         if (null != priOnline2Service.selectOne(wrapper)){ | 
 |  |  |         if (null != priOnline2Service.selectOne(wrapper)) { | 
 |  |  |             return R.parse(BaseRes.REPEAT).add(getComment(PriOnline2.class, String.valueOf(param.get("key")))); | 
 |  |  |         } | 
 |  |  |         return R.ok(); | 
 |  |  | 
 |  |  |         Date now = new Date(); | 
 |  |  |         Long memberId = priOnline2.getMemberId(); | 
 |  |  |         User member = userService.selectById(memberId); | 
 |  |  |         if (!member.getId().equals(getUserId())){ | 
 |  |  |         if (!member.getId().equals(getUserId())) { | 
 |  |  |             return R.error("抱歉,您没有审核的权限"); | 
 |  |  |         } | 
 |  |  |         List<SettleDto> planDtos = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); | 
 |  |  |         List<SettleDto> planDtoList = new ArrayList<>(); | 
 |  |  |         boolean sign = true; | 
 |  |  |         for (SettleDto dto : planDtos) { | 
 |  |  |             if (dto.getStep().equals(1)){ | 
 |  |  |             if (dto.getStep().equals(1)) { | 
 |  |  |                 priOnline2.setMemberId(dto.getUserId()); | 
 |  |  |             } | 
 |  |  |             if (sign && dto.getUserId().equals(memberId) && priOnline2.getSettle()+1==dto.getStep()){ | 
 |  |  |                 if (Cools.isEmpty(dto.getMsg())){ | 
 |  |  |                     dto.setMsg(DateUtils.convert(now)+" "+member.getNickname()+"回退审批"); | 
 |  |  |                 }else { | 
 |  |  |                     dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(now)+" "+member.getNickname()+"回退审批"); | 
 |  |  |             if (sign && dto.getUserId().equals(memberId) && priOnline2.getSettle() + 1 == dto.getStep()) { | 
 |  |  |                 if (Cools.isEmpty(dto.getMsg())) { | 
 |  |  |                     dto.setMsg(DateUtils.convert(now) + " " + member.getNickname() + "回退审批"); | 
 |  |  |                 } else { | 
 |  |  |                     dto.setMsg(dto.getMsg() + PZH + DateUtils.convert(now) + " " + member.getNickname() + "回退审批"); | 
 |  |  |                 } | 
 |  |  |                 sign = false; | 
 |  |  |             } | 
 |  |  |             if (sign){ | 
 |  |  |                 dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(now)+" "+member.getNickname()+"回退审批"); | 
 |  |  |             if (sign) { | 
 |  |  |                 dto.setMsg(dto.getMsg() + PZH + DateUtils.convert(now) + " " + member.getNickname() + "回退审批"); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             planDtoList.add(dto); | 
 |  |  | 
 |  |  |     @PostMapping(value = "/priOnline2/approval/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R approvalBusinessTrip(@RequestParam Long priOnlineId, | 
 |  |  |                                   @RequestParam(required = false) Long plannerId){ | 
 |  |  |                                   @RequestParam(required = false) Long plannerId) { | 
 |  |  |         PriOnline2 priOnline2 = priOnline2Service.selectById(priOnlineId); | 
 |  |  |         assert priOnline2 != null; | 
 |  |  |         Date now = new Date(); | 
 |  |  |         switch (priOnline2.getSettle()) { | 
 |  |  |             case 0: | 
 |  |  |                 // 本部门经理审核  节点负责人 | 
 |  |  |                 User user = userService.selectById(priOnline2.getMemberId()); | 
 |  |  |         Long nextUserId = getUserId(); | 
 |  |  |         User user = new User(); | 
 |  |  |         List<SettleDto> list = new ArrayList<>(); | 
 |  |  |  | 
 |  |  |                 Plan plan1 = planService.selectById(priOnline2.getItemId()); | 
 |  |  | //                PlanType planType1 = planTypeService.selectById(plan1.getPlanType()); | 
 |  |  | // | 
 |  |  | //                ProcessPermissions processPermissions1 = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "2-"+planType1.getType()));//2:核价流程 | 
 |  |  | //                User manager1 = userService.selectById(processPermissions1.getUserId());       // 获取报价流程节点2确认人 | 
 |  |  |         user = userService.selectById(priOnline2.getMemberId()); | 
 |  |  |  | 
 |  |  |                 if (Cools.isEmpty(getUser())) { | 
 |  |  |                     return R.error("抱歉,您没有提交的权限"); | 
 |  |  |                 } | 
 |  |  |                 if (!getUserId().equals(user.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); | 
 |  |  |                             if (Cools.isEmpty(dto.getMsg())){ | 
 |  |  |                                 dto.setMsg(user.getNickname() + "提交完成"); | 
 |  |  |                             }else { | 
 |  |  |                                 dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" " + user.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(plan1.getUserId()); | 
 |  |  |  | 
 |  |  |                 if (!priOnline2Service.updateById(priOnline2)) { | 
 |  |  |                     throw new CoolException("提交失败,请联系管理员"); | 
 |  |  |                 } | 
 |  |  |                 break; | 
 |  |  | //            case 1: | 
 |  |  | //                // 本部门经理审核  节点负责人 | 
 |  |  | //                Plan plan = planService.selectById(priOnline2.getItemId()); | 
 |  |  | //                PlanType planType = planTypeService.selectById(plan.getPlanType()); | 
 |  |  | // | 
 |  |  | //                ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 5).eq("process", "2-"+planType.getType()));//2:报价流程 | 
 |  |  | //                User manager = userService.selectById(processPermissions.getUserId());       // 获取报价流程节点2确认人 | 
 |  |  | // | 
 |  |  | ////                User manager = new User(); | 
 |  |  | ////                try{ | 
 |  |  | ////                    manager = userService.getDeptManager(getHostId(), getUser().getDeptId());        // 获取部门领导 | 
 |  |  | ////                }catch (Exception e){ | 
 |  |  | ////                    manager = user; | 
 |  |  | ////                } | 
 |  |  | //                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); | 
 |  |  | //                                if (Cools.isEmpty(dto.getMsg())){ | 
 |  |  | //                                    dto.setMsg(manager.getNickname() + "审批通过"); | 
 |  |  | //                                }else { | 
 |  |  | //                                    dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" " + manager.getNickname() + "审批通过"); | 
 |  |  | //                                } | 
 |  |  | //                                dto.setTime(DateUtils.convert(now)); | 
 |  |  | //                                break; | 
 |  |  | //                            default: | 
 |  |  | //                                break; | 
 |  |  | //                        } | 
 |  |  | //                    } | 
 |  |  | //                    priOnline2.setSettleMsg(JSON.toJSONString(list)); | 
 |  |  | // | 
 |  |  | //                    // 修改规划单状态 | 
 |  |  | //                    priOnline2.setSettle(2);  // 申请通过 | 
 |  |  | //                    priOnline2.setUpdateTime(now); | 
 |  |  | //                    priOnline2.setUpdateUserId(getUserId()); | 
 |  |  | //                    priOnline2.setMemberId(plan.getUserId()); | 
 |  |  | //                    if (!priOnline2Service.updateById(priOnline2)) { | 
 |  |  | //                        throw new CoolException("审核失败,请联系管理员"); | 
 |  |  | //                    } | 
 |  |  | //                } else { | 
 |  |  | //                    return R.error("抱歉,您没有审核的权限!!!"); | 
 |  |  | //                } | 
 |  |  | //                break; | 
 |  |  |             case 1: | 
 |  |  |                 // 业务员 | 
 |  |  |                 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 1: | 
 |  |  |                             dto.setCurr(Boolean.TRUE); | 
 |  |  |                             break; | 
 |  |  |                         case 2: | 
 |  |  |                             dto.setCurr(Boolean.TRUE); | 
 |  |  |                             if (Cools.isEmpty(dto.getMsg())){ | 
 |  |  |                                 dto.setMsg("业务员" + salesman0.getNickname() + "审批通过"); | 
 |  |  |                             }else { | 
 |  |  |                                 dto.setMsg(dto.getMsg()+PZH+DateUtils.convert(new Date())+" "+"业务员" + salesman0.getNickname() + "审批通过"); | 
 |  |  |                             } | 
 |  |  |                             dto.setTime(DateUtils.convert(new Date())); | 
 |  |  |                             break; | 
 |  |  |                         default: | 
 |  |  |                             break; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |                 priOnline2.setSettleMsg(JSON.toJSONString(list2)); | 
 |  |  |                 // 修改规划单状态 | 
 |  |  |                 priOnline2.setSettle(2);  // 审批通过 | 
 |  |  |                 priOnline2.setStatus(1); | 
 |  |  |                 priOnline2.setUpdateTime(new Date()); | 
 |  |  |                 priOnline2.setUpdateUserId(getUserId()); | 
 |  |  |  | 
 |  |  |                 if (!priOnline2Service.updateById(priOnline2)) { | 
 |  |  |                     throw new CoolException("确认失败,请联系管理员"); | 
 |  |  |                 } | 
 |  |  |                 try{ | 
 |  |  |                     priQuoteAdd(priOnline2.getId(),plannerId); | 
 |  |  |                 }catch (Exception e){ | 
 |  |  |                     return R.error("自动生成报价单失败"); | 
 |  |  |                 } | 
 |  |  |                 break; | 
 |  |  |             default: | 
 |  |  |                 return R.error(); | 
 |  |  |         if (Cools.isEmpty(getUser()) || Cools.isEmpty(user)){ | 
 |  |  |             return R.error("抱歉,您无需确认!!!"); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         if (!getUserId().equals(user.getId())) { | 
 |  |  |             return R.error("抱歉,您无需确认!!!"); | 
 |  |  |         } | 
 |  |  |         // 修改 settle 步骤数据 | 
 |  |  |         list = JSON.parseArray(priOnline2.getSettleMsg(), SettleDto.class); | 
 |  |  |         for (SettleDto dto : list) { | 
 |  |  |             if (dto.getStep().equals(priOnline2.getSettle())) { | 
 |  |  |                 dto.setCurr(Boolean.TRUE); | 
 |  |  |             } else if (dto.getStep().equals(priOnline2.getSettle() + 1)) { | 
 |  |  |                 dto.setCurr(Boolean.TRUE); | 
 |  |  |                 if (Cools.isEmpty(dto.getMsg())) { | 
 |  |  |                     dto.setMsg(user.getNickname() + "审批通过"); | 
 |  |  |                 } else { | 
 |  |  |                     dto.setMsg(dto.getMsg() + PZH + DateUtils.convert(new Date()) + " " + user.getNickname() + "审批通过"); | 
 |  |  |                 } | 
 |  |  |                 dto.setTime(DateUtils.convert(new Date())); | 
 |  |  |             } else if (dto.getStep().equals(priOnline2.getSettle() + 2)) { | 
 |  |  |                 nextUserId=dto.getUserId(); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         priOnline2.setSettleMsg(JSON.toJSONString(list)); | 
 |  |  |         // 修改规划单状态 | 
 |  |  |         priOnline2.setSettle(priOnline2.getSettle() + 1);  // 审批通过 | 
 |  |  |         if (user.getId().equals(priOnline2.getUserId())) { | 
 |  |  |             priOnline2.setStatus(1); | 
 |  |  |         } | 
 |  |  |         priOnline2.setUpdateTime(now); | 
 |  |  |         priOnline2.setUpdateUserId(getUserId()); | 
 |  |  |         priOnline2.setMemberId(nextUserId); | 
 |  |  |  | 
 |  |  |         if (!priOnline2Service.updateById(priOnline2)) { | 
 |  |  |             throw new CoolException("确认失败,请联系管理员"); | 
 |  |  |         } | 
 |  |  |         if (user.getId().equals(priOnline2.getUserId())) { | 
 |  |  |             try { | 
 |  |  |                 priQuoteAdd(priOnline2.getId(), plannerId); | 
 |  |  |             } catch (Exception e) { | 
 |  |  |                 return R.error("自动生成报价单失败"); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         return R.ok("审批成功"); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     public void priQuoteAdd(Long priOnlineId,Long priType){ | 
 |  |  |     public void priQuoteAdd(Long priOnlineId, Long priType) { | 
 |  |  |         Pri pri = null; | 
 |  |  |         if (priType==1L){ | 
 |  |  |         if (priType == 1L) { | 
 |  |  |             pri = priService.selectById(114); | 
 |  |  |         }else { | 
 |  |  |         } else { | 
 |  |  |             pri = priService.selectById(115); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  | 
 |  |  | //        priQuote.setForm(JSON.toJSONString(map));     // 自定义表单内容 | 
 |  |  |         priQuote.setSettle(1);  // 1.开始 | 
 |  |  |         User manager = new User(); | 
 |  |  |         try{ | 
 |  |  |         try { | 
 |  |  |             manager = userService.getDeptManager(getHostId(), getUser().getDeptId());        // 获取部门领导 | 
 |  |  |         }catch (Exception e){ | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             manager = getUser(); | 
 |  |  |         } | 
 |  |  |         priQuote.setMemberId(manager.getId()); | 
 |  |  |  | 
 |  |  |         ProcessPermissions processPermissions = processPermissionsService.selectOne(new EntityWrapper<ProcessPermissions>().eq("process_memo", 2).eq("process", "3-1"));//2:报价流程 | 
 |  |  |         User president = userService.selectById(processPermissions.getUserId());       // 获取报价流程节点3-1确认人 | 
 |  |  |         priQuote.setSettleMsg(JSON.toJSONString(SettleDto.initPriQuote(plan, manager,president,getUser()))); | 
 |  |  |         priQuote.setSettleMsg(JSON.toJSONString(SettleDto.initPriQuote(plan, manager, president, getUser()))); | 
 |  |  |  | 
 |  |  |         planService.updateById(plan); | 
 |  |  |  | 
 |  |  | 
 |  |  |  | 
 |  |  |     @PostMapping(value = "/priOnline2/priQuoteAdd/list/auth") | 
 |  |  |     @ManagerAuth | 
 |  |  |     public R priOnline2priQuoteAdd(@RequestParam Long planId){ | 
 |  |  |     public R priOnline2priQuoteAdd(@RequestParam Long planId) { | 
 |  |  |         List<KeyValueVo> vos = new ArrayList<>(); | 
 |  |  |         vos.add(new KeyValueVo("报价模板1", 1L)); | 
 |  |  |         vos.add(new KeyValueVo("报价模板2", 2L)); | 
 
 |  |  | 
 |  |  |     private Integer settle; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 进度 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "进度") | 
 |  |  |     @TableField("settle_size") | 
 |  |  |     private Integer settleSize; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 流程进度 | 
 |  |  |      */ | 
 |  |  |     @ApiModelProperty(value= "流程进度") | 
 |  |  | 
 |  |  |  | 
 |  |  |     public PriOnline2() {} | 
 |  |  |  | 
 |  |  |     public PriOnline2(String title, String sheetData, Date createTime, String filepath,Integer settle) { | 
 |  |  |     public PriOnline2(String title, String sheetData, Date createTime, String filepath,Integer settle,Integer settleSize) { | 
 |  |  |         this.title = title; | 
 |  |  |         this.sheetData = sheetData; | 
 |  |  |         this.createTime = createTime; | 
 |  |  |         this.filepath = filepath; | 
 |  |  |         this.settle = settle; | 
 |  |  |         this.settleSize = settleSize; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | //    PriOnline priOnline = new PriOnline( | 
 |  |  | 
 |  |  |             case 1: | 
 |  |  |                 return "等待确认"; | 
 |  |  |             case 2: | 
 |  |  |                 return this.settleSize.equals(this.settle+1)? "审批通过" : "等待确认"; | 
 |  |  |             case 3: | 
 |  |  |                 return "审批通过"; | 
 |  |  |             default: | 
 |  |  |                 return String.valueOf(this.settle); | 
 
 |  |  | 
 |  |  |         if (null == this.processMemo){ return null; } | 
 |  |  |         switch (this.processMemo){ | 
 |  |  |             case 1: | 
 |  |  |                 return "核价流程"; | 
 |  |  |                 return "规划流程"; | 
 |  |  |             case 2: | 
 |  |  |                 return "报价流程"; | 
 |  |  |             case 3: | 
 |  |  |                 return "报销流程"; | 
 |  |  |             case 4: | 
 |  |  |                 return "出差流程"; | 
 |  |  |                 return "集成核价流程"; | 
 |  |  |             case 5: | 
 |  |  |                 return "核价流程"; | 
 |  |  |                 return "货架核价流程"; | 
 |  |  |             case 7: | 
 |  |  |                 return "合同管理"; | 
 |  |  |             case 101: | 
 
 |  |  | 
 |  |  |             headers.put("Authorization", "APPCODE " + APPCODE); | 
 |  |  |  | 
 |  |  |             param.put("templateId", "M6F3C81FE3"); | 
 |  |  |             param.put("receive", phone); | 
 |  |  |             param.put("receive", "13083813523"); | 
 |  |  |             param.put("tag", code); | 
 |  |  |  | 
 |  |  |             String response = new HttpHandler.Builder() | 
 
 |  |  | 
 |  |  |                 and | 
 |  |  |                 ( | 
 |  |  |                     <if test="userId != null and userId != ''"> | 
 |  |  |                         user_id = #{userId} | 
 |  |  |                         user_id = #{userId} or | 
 |  |  |                     </if> | 
 |  |  |                     <if test="userId == null or userId == ''"> | 
 |  |  |                         user_id is not null | 
 |  |  |                     </if> | 
 |  |  |                     or | 
 |  |  |                     director = #{userId} or | 
 |  |  |                     mc.id in | 
 |  |  |                     ( | 
 |  |  |                         select | 
 |  |  | 
 |  |  |         LEFT JOIN sys_dept sd ON mc.dept_id = sd.id | 
 |  |  |         WHERE 1=1 | 
 |  |  |         and director is null | 
 |  |  |         <choose> | 
 |  |  |             <when test="deptId != null and deptId != ''"> | 
 |  |  |                 AND ((CHARINDEX(','+#{deptId}+',', ','+sd.path+',') > 0 OR sd.id = #{deptId}) | 
 |  |  |                 or | 
 |  |  |                 ( | 
 |  |  |                 user_id = #{userId} | 
 |  |  |                 or | 
 |  |  |                 mc.id in | 
 |  |  |                 ( | 
 |  |  |                 select | 
 |  |  |                 cstmr_id | 
 |  |  |                 from man_cstmr_foll | 
 |  |  |                 where 1=1 | 
 |  |  |                 and user_id = #{userId} | 
 |  |  |                 ) | 
 |  |  |                 )) | 
 |  |  |             </when> | 
 |  |  |             <otherwise> | 
 |  |  |                 and | 
 |  |  |                 ( | 
 |  |  |                 <if test="userId != null and userId != ''"> | 
 |  |  |                     user_id = #{userId} | 
 |  |  |                 </if> | 
 |  |  |                 <if test="userId == null or userId == ''"> | 
 |  |  |                     user_id is not null | 
 |  |  |                 </if> | 
 |  |  |                 or | 
 |  |  |                 mc.id in | 
 |  |  |                 ( | 
 |  |  |                 select | 
 |  |  |                 cstmr_id | 
 |  |  |                 from man_cstmr_foll | 
 |  |  |                 where 1=1 | 
 |  |  |                 and user_id = #{userId} | 
 |  |  |                 ) | 
 |  |  |                 ) | 
 |  |  |             </otherwise> | 
 |  |  |         </choose> | 
 |  |  | <!--        <choose>--> | 
 |  |  | <!--            <when test="deptId != null and deptId != ''">--> | 
 |  |  | <!--                AND ((CHARINDEX(','+#{deptId}+',', ','+sd.path+',') > 0 OR sd.id = #{deptId})--> | 
 |  |  | <!--                or--> | 
 |  |  | <!--                (--> | 
 |  |  | <!--                user_id = #{userId}--> | 
 |  |  | <!--                or--> | 
 |  |  | <!--                mc.id in--> | 
 |  |  | <!--                (--> | 
 |  |  | <!--                select--> | 
 |  |  | <!--                cstmr_id--> | 
 |  |  | <!--                from man_cstmr_foll--> | 
 |  |  | <!--                where 1=1--> | 
 |  |  | <!--                and user_id = #{userId}--> | 
 |  |  | <!--                )--> | 
 |  |  | <!--                ))--> | 
 |  |  | <!--            </when>--> | 
 |  |  | <!--            <otherwise>--> | 
 |  |  | <!--                and--> | 
 |  |  | <!--                (--> | 
 |  |  | <!--                <if test="userId != null and userId != ''">--> | 
 |  |  | <!--                    user_id = #{userId}--> | 
 |  |  | <!--                </if>--> | 
 |  |  | <!--                <if test="userId == null or userId == ''">--> | 
 |  |  | <!--                    user_id is not null--> | 
 |  |  | <!--                </if>--> | 
 |  |  | <!--                or--> | 
 |  |  | <!--                mc.id in--> | 
 |  |  | <!--                (--> | 
 |  |  | <!--                select--> | 
 |  |  | <!--                cstmr_id--> | 
 |  |  | <!--                from man_cstmr_foll--> | 
 |  |  | <!--                where 1=1--> | 
 |  |  | <!--                and user_id = #{userId}--> | 
 |  |  | <!--                )--> | 
 |  |  | <!--                )--> | 
 |  |  | <!--            </otherwise>--> | 
 |  |  | <!--        </choose>--> | 
 |  |  |         <if test="hostId != null"> | 
 |  |  |             and mc.host_id = #{hostId} | 
 |  |  |         </if> | 
 |  |  |         <if test="condition != null and condition != ''"> | 
 |  |  |             and ( | 
 |  |  |             mc.uuid like concat('%',#{condition},'%') | 
 |  |  |             or mc.name like concat('%',#{condition},'%') | 
 |  |  |             or mc.simple like concat('%',#{condition},'%') | 
 |  |  |             or mc.rela like concat('%',#{condition},'%') | 
 |  |  |             or mc.tel like concat('%',#{condition},'%') | 
 |  |  |             or mc.contacts like concat('%',#{condition},'%') | 
 |  |  |             or mc.remarks like concat('%',#{condition},'%') | 
 |  |  |             or mc.director like concat('%',#{condition},'%') | 
 |  |  |             or mc.addr like concat('%',#{condition},'%') | 
 |  |  |             ) | 
 |  |  |             and mc.name like concat('%',#{condition},'%') | 
 |  |  |         </if> | 
 |  |  |         ORDER BY mc.create_time DESC | 
 |  |  |     </select> | 
 
 |  |  | 
 |  |  |         <result column="update_time" property="updateTime" /> | 
 |  |  |         <result column="check_data" property="checkData" /> | 
 |  |  |         <result column="settle" property="settle" /> | 
 |  |  |         <result column="settle_size" property="settleSize" /> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <!-- 查询结果不包含excel数据data,以免结果集过大 --> | 
 |  |  | 
 |  |  |         <result column="status" property="status" /> | 
 |  |  |         <result column="update_time" property="updateTime" /> | 
 |  |  |         <result column="settle" property="settle" /> | 
 |  |  |         <result column="settle_size" property="settleSize" /> | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <select id="listByPage" resultMap="NoDataResultMap"> | 
 
 |  |  | 
 |  |  |     base: baseUrl + "/static/layui/lay/modules/" | 
 |  |  | }).extend({ | 
 |  |  |     cascader: 'cascader/cascader', | 
 |  |  | }).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function() { | 
 |  |  | }).use(['table', 'laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function () { | 
 |  |  |     var table = layui.table; | 
 |  |  |     var $ = layui.jquery; | 
 |  |  |     var layer = layui.layer; | 
 |  |  | 
 |  |  |                 hide: false | 
 |  |  |             } | 
 |  |  |             , {field: 'itemId', align: 'center', title: '规划单号', hide: true} | 
 |  |  |             , {field: 'status$', align: 'center', title: '状态',hide : false} | 
 |  |  |             , {field: 'status$', align: 'center', title: '状态', hide: false} | 
 |  |  |             // ,{field: 'memberId$', align: 'center',title: ''} | 
 |  |  |             , { | 
 |  |  |                 field: 'settle$', | 
 |  |  | 
 |  |  |                 event: 'more', | 
 |  |  |                 hide: false | 
 |  |  |             } | 
 |  |  |             , {field: 'user$', align: 'center', title: '业务员',hide : false} | 
 |  |  |             , {field: 'deptId$', align: 'center', title: '部门',hide : true} | 
 |  |  |             , {field: 'checkDataStatus$', align: 'center', title: '报价数据',hide : false} | 
 |  |  |             , {field: 'createTime$', align: 'center', title: '创建时间',hide : true} | 
 |  |  |             , {field: 'updateUserId$', align: 'center', title: '更新人员',hide : false} | 
 |  |  |             , {field: 'updateTime$', align: 'center', title: '更新时间',hide : false} | 
 |  |  |             , {field: 'settleSize', align: 'center', title: '流程长度', hide: true} | 
 |  |  |             , {field: 'user$', align: 'center', title: '业务员', hide: false} | 
 |  |  |             , {field: 'deptId$', align: 'center', title: '部门', hide: true} | 
 |  |  |             , {field: 'checkDataStatus$', align: 'center', title: '报价数据', hide: false} | 
 |  |  |             , {field: 'createTime$', align: 'center', title: '创建时间', hide: true} | 
 |  |  |             , {field: 'updateUserId$', align: 'center', title: '更新人员', hide: false} | 
 |  |  |             , {field: 'updateTime$', align: 'center', title: '更新时间', hide: false} | 
 |  |  |             , {fixed: 'right', title: '操作', align: 'center', toolbar: '#operate', width: 350} | 
 |  |  |         ]], | 
 |  |  |         request: { | 
 |  |  | 
 |  |  |                     title: data.name | 
 |  |  |                 }, function (i) { | 
 |  |  |                     layer.close(i); | 
 |  |  |                     console.log(data) | 
 |  |  |                     approvalEnd(data.id); | 
 |  |  |                 }); | 
 |  |  |                 break; | 
 |  |  | 
 |  |  |                     offset: '200px', | 
 |  |  |                     title: data.name | 
 |  |  |                 }, function (i) { | 
 |  |  |                     console.log(data) | 
 |  |  |                     layer.close(i); | 
 |  |  |                     // 指定规划员 | 
 |  |  |                     if (data.settle === 1) { | 
 |  |  |                     // 指定模板 | 
 |  |  |                     if ((data.settle === 1 && data.settleSize===3) || (data.settle===2 && data.settleSize===4)) { | 
 |  |  |                         admin.open({ | 
 |  |  |                             type: 1, | 
 |  |  |                             area: '300px', | 
 |  |  |                             title: '选择规划员', | 
 |  |  |                             title: '选择报价模板', | 
 |  |  |                             content: $('#plannerListDialog').html(), | 
 |  |  |                             success: function (layero, dIndex) { | 
 |  |  |                                 let plannerSel = xmSelect.render({ | 
 |  |  | 
 |  |  |             } | 
 |  |  |         }); | 
 |  |  |     } | 
 |  |  |     function approvalEnd(planId, plannerId, dIdx) { | 
 |  |  |  | 
 |  |  |     function approvalEnd(priOnlineId, plannerId, dIdx) { | 
 |  |  |         let loadIndex = layer.load(2); | 
 |  |  |         $.ajax({ | 
 |  |  |             url: baseUrl+"/priOnline2/approvalEnd/auth", | 
 |  |  |             url: baseUrl + "/priOnline2/approvalEnd/auth", | 
 |  |  |             headers: {'token': localStorage.getItem('token')}, | 
 |  |  |             data: { | 
 |  |  |                 priOnlineId: priOnlineId, | 
 |  |  | 
 |  |  |                     layer.close(dIdx); | 
 |  |  |                 } | 
 |  |  |                 layer.close(loadIndex); | 
 |  |  |                 if (res.code === 200){ | 
 |  |  |                 if (res.code === 200) { | 
 |  |  |                     layer.msg(res.msg, {icon: 1}); | 
 |  |  |                     tableReload(); | 
 |  |  |                 } else if (res.code === 403){ | 
 |  |  |                     top.location.href = baseUrl+"/"; | 
 |  |  |                 } else if (res.code === 403) { | 
 |  |  |                     top.location.href = baseUrl + "/"; | 
 |  |  |                 } else { | 
 |  |  |                     layer.msg(res.msg, {icon: 2}); | 
 |  |  |                 } | 
 |  |  | 
 |  |  |     function approval(priOnlineId, plannerId, dIdx) { | 
 |  |  |         let loadIndex = layer.load(2); | 
 |  |  |         $.ajax({ | 
 |  |  |             url: baseUrl+"/priOnline2/approval/auth", | 
 |  |  |             url: baseUrl + "/priOnline2/approval/auth", | 
 |  |  |             headers: {'token': localStorage.getItem('token')}, | 
 |  |  |             data: { | 
 |  |  |                 priOnlineId: priOnlineId, | 
 |  |  | 
 |  |  |                     layer.close(dIdx); | 
 |  |  |                 } | 
 |  |  |                 layer.close(loadIndex); | 
 |  |  |                 if (res.code === 200){ | 
 |  |  |                 if (res.code === 200) { | 
 |  |  |                     layer.msg(res.msg, {icon: 1}); | 
 |  |  |                     tableReload(); | 
 |  |  |                 } else if (res.code === 403){ | 
 |  |  |                     top.location.href = baseUrl+"/"; | 
 |  |  |                 } else if (res.code === 403) { | 
 |  |  |                     top.location.href = baseUrl + "/"; | 
 |  |  |                 } else { | 
 |  |  |                     layer.msg(res.msg, {icon: 2}); | 
 |  |  |                 } | 
 |  |  | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | // 关闭动作 | 
 |  |  | $(document).on('click','#data-detail-close', function () { | 
 |  |  | $(document).on('click', '#data-detail-close', function () { | 
 |  |  |     parent.layer.closeAll(); | 
 |  |  | }); | 
 |  |  |  | 
 |  |  | function tableReload(child) { | 
 |  |  |     var searchData = {}; | 
 |  |  |     $.each($('#search-box [name]').serializeArray(), function() { | 
 |  |  |     $.each($('#search-box [name]').serializeArray(), function () { | 
 |  |  |         searchData[this.name] = this.value; | 
 |  |  |     }); | 
 |  |  |     (child ? parent.tableIns : tableIns).reload({ | 
 |  |  | 
 |  |  |         }, | 
 |  |  |         done: function (res, curr, count) { | 
 |  |  |             if (res.code === 403) { | 
 |  |  |                 top.location.href = baseUrl+"/"; | 
 |  |  |                 top.location.href = baseUrl + "/"; | 
 |  |  |             } | 
 |  |  |             pageCurr=curr; | 
 |  |  |             pageCurr = curr; | 
 |  |  |             if (res.data.length === 0 && count !== 0) { | 
 |  |  |                 tableIns.reload({ | 
 |  |  |                     where: searchData, | 
 |  |  |                     page: { | 
 |  |  |                         curr: pageCurr-1 | 
 |  |  |                         curr: pageCurr - 1 | 
 |  |  |                     } | 
 |  |  |                 }); | 
 |  |  |                 pageCurr -= 1; | 
 |  |  | 
 |  |  |     for (var val in data) { | 
 |  |  |         var find = el.find(":input[id='" + val + "']"); | 
 |  |  |         find.val(data[val]); | 
 |  |  |         if (showImg){ | 
 |  |  |         if (showImg) { | 
 |  |  |             var next = find.next(); | 
 |  |  |             if (next.get(0)){ | 
 |  |  |             if (next.get(0)) { | 
 |  |  |                 if (next.get(0).localName === "img") { | 
 |  |  |                     find.hide(); | 
 |  |  |                     next.attr("src", data[val]); | 
 |  |  | 
 |  |  |  | 
 |  |  | function detailScreen(index) { | 
 |  |  |     var detail = layer.getChildFrame('#data-detail', index); | 
 |  |  |     var height = detail.height()+60; | 
 |  |  |     if (height > ($(window).height()*0.9)) { | 
 |  |  |         height = ($(window).height()*0.9); | 
 |  |  |     var height = detail.height() + 60; | 
 |  |  |     if (height > ($(window).height() * 0.9)) { | 
 |  |  |         height = ($(window).height() * 0.9); | 
 |  |  |     } | 
 |  |  |     layer.style(index, { | 
 |  |  |         top: (($(window).height()-height)/3)+"px", | 
 |  |  |         height: height+'px' | 
 |  |  |         top: (($(window).height() - height) / 3) + "px", | 
 |  |  |         height: height + 'px' | 
 |  |  |     }); | 
 |  |  |     $(".layui-layer-shade").remove(); | 
 |  |  | } | 
 
 |  |  | 
 |  |  | <!DOCTYPE html> | 
 |  |  | <html lang="en"> | 
 |  |  | <head> | 
 |  |  |   <meta charset="utf-8"> | 
 |  |  |   <title></title> | 
 |  |  |   <meta name="renderer" content="webkit"> | 
 |  |  |   <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
 |  |  |   <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | 
 |  |  |   <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/css/tree.css" media="all"> | 
 |  |  |   <link rel="stylesheet" href="../../static/layui/lay/modules/formDesigner/coolForm.css" /> | 
 |  |  |   <style> | 
 |  |  |     .nav-box { | 
 |  |  |       position: absolute; | 
 |  |  |       top: 1px; | 
 |  |  |       left: 5px; | 
 |  |  |     } | 
 |  |  |     .nav-box-item { | 
 |  |  |       display: inline-block; | 
 |  |  |       vertical-align: middle; | 
 |  |  |       margin-right: 5px; | 
 |  |  |     } | 
 |  |  |     <meta charset="utf-8"> | 
 |  |  |     <title></title> | 
 |  |  |     <meta name="renderer" content="webkit"> | 
 |  |  |     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
 |  |  |     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | 
 |  |  |     <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/css/tree.css" media="all"> | 
 |  |  |     <link rel="stylesheet" href="../../static/layui/lay/modules/formDesigner/coolForm.css"/> | 
 |  |  |     <style> | 
 |  |  |         .nav-box { | 
 |  |  |             position: absolute; | 
 |  |  |             top: 1px; | 
 |  |  |             left: 5px; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |   </style> | 
 |  |  |         .nav-box-item { | 
 |  |  |             display: inline-block; | 
 |  |  |             vertical-align: middle; | 
 |  |  |             margin-right: 5px; | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     </style> | 
 |  |  | </head> | 
 |  |  | <body> | 
 |  |  |  | 
 |  |  | <div class="layui-fluid"> | 
 |  |  |   <div class="layui-card"> | 
 |  |  |     <div class="layui-card-body"> | 
 |  |  |       <div id="search-box" class="layui-form toolbar" style="display: flex;justify-content: flex-end;position: relative"> | 
 |  |  |         <div class="nav-box"> | 
 |  |  |           <div class="nav-box-item"> | 
 |  |  |             <i class="layui-icon" style="color: #1890ff;font-weight: bold"></i> | 
 |  |  |           </div> | 
 |  |  |           <div class="nav-box-item"> | 
 |  |  |             <button id="organization" style="border: none;padding-right: 35px;" class="layui-btn layui-btn-primary icon-btn"> | 
 |  |  |               未知 | 
 |  |  |             </button> | 
 |  |  |           </div> | 
 |  |  |         </div> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |           <div class="layui-inline"> | 
 |  |  |             <div class="layui-input-inline"> | 
 |  |  |               <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off" style="border-color: #e1e1e1"> | 
 |  |  |     <div class="layui-card"> | 
 |  |  |         <div class="layui-card-body"> | 
 |  |  |             <div id="search-box" class="layui-form toolbar" | 
 |  |  |                  style="display: flex;justify-content: flex-end;position: relative"> | 
 |  |  |                 <div class="nav-box"> | 
 |  |  |                     <div class="nav-box-item"> | 
 |  |  |                         <i class="layui-icon" style="color: #1890ff;font-weight: bold"></i> | 
 |  |  |                     </div> | 
 |  |  |                     <div class="nav-box-item"> | 
 |  |  |                         <button id="organization" style="border: none;padding-right: 35px;" | 
 |  |  |                                 class="layui-btn layui-btn-primary icon-btn"> | 
 |  |  |                             未知 | 
 |  |  |                         </button> | 
 |  |  |                     </div> | 
 |  |  |                 </div> | 
 |  |  |                 <div class="layui-form-item"> | 
 |  |  |                     <div class="layui-inline"> | 
 |  |  |                         <div class="layui-input-inline"> | 
 |  |  |                             <input class="layui-input" type="text" name="condition" placeholder="请输入" autocomplete="off" | 
 |  |  |                                    style="border-color: #e1e1e1"> | 
 |  |  |                         </div> | 
 |  |  |                     </div> | 
 |  |  |                     <div class="layui-inline">  | 
 |  |  |                         <button class="layui-btn icon-btn layui-btn-sm" lay-filter="search" lay-submit> | 
 |  |  |                             <i class="layui-icon"></i>搜索 | 
 |  |  |                         </button> | 
 |  |  |                     </div> | 
 |  |  |                 </div> | 
 |  |  |             </div> | 
 |  |  |           </div> | 
 |  |  |           <div class="layui-inline">  | 
 |  |  |             <button class="layui-btn icon-btn layui-btn-sm" lay-filter="search" lay-submit> | 
 |  |  |               <i class="layui-icon"></i>搜索 | 
 |  |  |             </button> | 
 |  |  |           </div> | 
 |  |  |             <table class="layui-hide" id="priOnline" lay-filter="priOnline"></table> | 
 |  |  |         </div> | 
 |  |  |       </div> | 
 |  |  |       <table class="layui-hide" id="priOnline" lay-filter="priOnline"></table> | 
 |  |  |     </div> | 
 |  |  |   </div> | 
 |  |  | </div> | 
 |  |  |  | 
 |  |  | <script type="text/html" id="toolbar"> | 
 |  |  |   <div class="layui-btn-container"> | 
 |  |  |     <button class="layui-btn layui-btn-sm" lay-event="addBlank">新增核价</button> | 
 |  |  |     <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteData">删除</button> | 
 |  |  |   </div> | 
 |  |  |     <div class="layui-btn-container"> | 
 |  |  |         <button class="layui-btn layui-btn-sm" lay-event="addBlank">新增核价</button> | 
 |  |  |         <button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteData">删除</button> | 
 |  |  |     </div> | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <form id="uploadFile" enctype="multipart/form-data" style="display: none;" > | 
 |  |  |   <input type="file" name="file" id="uploadQuote"> | 
 |  |  |   <input type="button" onclick="upload()" value="上传"/> | 
 |  |  | <form id="uploadFile" enctype="multipart/form-data" style="display: none;"> | 
 |  |  |     <input type="file" name="file" id="uploadQuote"> | 
 |  |  |     <input type="button" onclick="upload()" value="上传"/> | 
 |  |  | </form> | 
 |  |  |  | 
 |  |  |  | 
 |  |  | <script type="text/html" id="operate"> | 
 |  |  |   {{# if (d.settle == 0) { }} | 
 |  |  |     {{# if ((d.settle == 0) || (d.settle == 1 && d.settleSize == 4)){ }} | 
 |  |  |     <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">提交</a> | 
 |  |  |     <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">删除</a> | 
 |  |  |   {{# } }} | 
 |  |  |   {{# if (d.settle == 1) { }} | 
 |  |  |     {{# } }} | 
 |  |  |     {{# if ((d.settle == 1 && d.settleSize == 3) || (d.settle == 2 && d.settleSize == 4)){ }} | 
 |  |  |     <a class="layui-btn layui-btn-xs btn-edit" lay-event="approval">确认</a> | 
 |  |  |     <a class="layui-btn layui-btn-xs btn-edit" lay-event="approvalEnd">回退审批</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-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> | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <script type="text/html" id="plannerListDialog"> | 
 |  |  |   <div class="layui-form admin-form"> | 
 |  |  |     <div class="model-form" style="padding: 30px"> | 
 |  |  |       <div id="plannerXmlSel"></div> | 
 |  |  |     <div class="layui-form admin-form"> | 
 |  |  |         <div class="model-form" style="padding: 30px"> | 
 |  |  |             <div id="plannerXmlSel"></div> | 
 |  |  |         </div> | 
 |  |  |         <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 layui-btn-primary" type="button" ew-event="closeDialog">取消</button> | 
 |  |  |         </div> | 
 |  |  |     </div> | 
 |  |  |     <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 layui-btn-primary" type="button" ew-event="closeDialog">取消</button> | 
 |  |  |     </div> | 
 |  |  |   </div> | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> | 
 |  |  | 
 |  |  | <script type="text/javascript" src="../../static/js/priOnline2/priOnline.js" charset="utf-8"></script> | 
 |  |  | <!-- 表单弹窗 --> | 
 |  |  | <script type="text/html" id="editDialog"> | 
 |  |  |   <div id="detail" lay-filter="detail" class="layui-form admin-form model-form"> | 
 |  |  |     <input name="id" type="hidden"> | 
 |  |  |     <div class="layui-row"> | 
 |  |  |       <div class="layui-col-md12"> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |           <label class="layui-form-label layui-form-required">项目名: </label> | 
 |  |  |           <div class="layui-input-block cool-auto-complete"> | 
 |  |  |             <input class="layui-input" name="planId" placeholder="请输入项目名" style="display: none" lay-verify="required"> | 
 |  |  |             <input id="planId$" name="planId$" 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="planQueryNameToRobBydirector" onkeyup="autoLoad(this.getAttribute('data-key'))"> | 
 |  |  |               <select class="cool-auto-complete-window-select" data-key="planQueryNameToRobBydirectorSelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> | 
 |  |  |               </select> | 
 |  |  |     <div id="detail" lay-filter="detail" class="layui-form admin-form model-form"> | 
 |  |  |         <input name="id" type="hidden"> | 
 |  |  |         <div class="layui-row"> | 
 |  |  |             <div class="layui-col-md12"> | 
 |  |  |                 <div class="layui-form-item"> | 
 |  |  |                     <label class="layui-form-label layui-form-required">项目名: </label> | 
 |  |  |                     <div class="layui-input-block cool-auto-complete"> | 
 |  |  |                         <input class="layui-input" name="planId" placeholder="请输入项目名" style="display: none" | 
 |  |  |                                lay-verify="required"> | 
 |  |  |                         <input id="planId$" name="planId$" 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="planQueryNameToRobBydirector" | 
 |  |  |                                    onkeyup="autoLoad(this.getAttribute('data-key'))"> | 
 |  |  |                             <select class="cool-auto-complete-window-select" | 
 |  |  |                                     data-key="planQueryNameToRobBydirectorSelect" | 
 |  |  |                                     onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> | 
 |  |  |                             </select> | 
 |  |  |                         </div> | 
 |  |  |                     </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" type="text" name="name" placeholder="核价名" autocomplete="off"> | 
 |  |  |                     </div> | 
 |  |  |                 </div> | 
 |  |  |  | 
 |  |  |                 <div class="layui-form-item"> | 
 |  |  |                     <label class="layui-form-label layui-form-required">模板: </label> | 
 |  |  |                     <div class="layui-input-block"> | 
 |  |  |                         <input type="radio" name="template" value="1" title="模板1" checked> | 
 |  |  |                         <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i> | 
 |  |  |                             <div>模板1</div> | 
 |  |  |                         </div> | 
 |  |  |                         <input type="radio" name="template" value="2" title="模板2" disabled> | 
 |  |  |                         <div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i> | 
 |  |  |                             <div>模板2</div> | 
 |  |  |                         </div> | 
 |  |  |                     </div> | 
 |  |  |                 </div> | 
 |  |  |             </div> | 
 |  |  |           </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" type="text" name="name" placeholder="核价名" autocomplete="off"> | 
 |  |  |           </div> | 
 |  |  |         <hr class="layui-bg-gray"> | 
 |  |  |         <div class="layui-form-item text-right"> | 
 |  |  |             <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 class="layui-form-item"> | 
 |  |  |           <label class="layui-form-label layui-form-required">模板: </label> | 
 |  |  |           <div class="layui-input-block"> | 
 |  |  |             <input type="radio" name="template" value="1" title="模板1" checked><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>模板1</div></div> | 
 |  |  |             <input type="radio" name="template" value="2" title="模板2" disabled><div class="layui-unselect layui-form-radio"><i class="layui-anim layui-icon"></i><div>模板2</div></div> | 
 |  |  |           </div> | 
 |  |  |         </div> | 
 |  |  |       </div> | 
 |  |  |     </div> | 
 |  |  |     <hr class="layui-bg-gray"> | 
 |  |  |     <div class="layui-form-item text-right"> | 
 |  |  |       <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> | 
 |  |  | </script> | 
 |  |  |  | 
 |  |  | <!-- 表单弹窗 --> | 
 |  |  | <script type="text/html" id="editStatus"> | 
 |  |  |   <div id="editStatusDetail" lay-filter="editStatusDetail" class="layui-form admin-form model-form"> | 
 |  |  |     <input name="id" type="hidden"> | 
 |  |  |     <div class="layui-row"> | 
 |  |  |       <div class="layui-col-md12"> | 
 |  |  |         <div class="layui-form-item"> | 
 |  |  |           <label class="layui-form-label layui-form-required">状态: </label> | 
 |  |  |           <div class="layui-input-block"> | 
 |  |  |             <select name="status" lay-vertype="tips" lay-verify="required"> | 
 |  |  |               <option value="">请选择状态</option> | 
 |  |  |               <option value="1">已完成</option> | 
 |  |  |               <option value="0">未完成</option> | 
 |  |  |             </select> | 
 |  |  |           </div> | 
 |  |  |         </div> | 
 |  |  |     <div id="editStatusDetail" lay-filter="editStatusDetail" class="layui-form admin-form model-form"> | 
 |  |  |         <input name="id" type="hidden"> | 
 |  |  |         <div class="layui-row"> | 
 |  |  |             <div class="layui-col-md12"> | 
 |  |  |                 <div class="layui-form-item"> | 
 |  |  |                     <label class="layui-form-label layui-form-required">状态: </label> | 
 |  |  |                     <div class="layui-input-block"> | 
 |  |  |                         <select name="status" lay-vertype="tips" lay-verify="required"> | 
 |  |  |                             <option value="">请选择状态</option> | 
 |  |  |                             <option value="1">已完成</option> | 
 |  |  |                             <option value="0">未完成</option> | 
 |  |  |                         </select> | 
 |  |  |                     </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" name="templateName" 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" name="templateName" 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" name="title" 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" name="title" placeholder="请输入表格标题" autocomplete="off" | 
 |  |  |                                lay-verify="required"> | 
 |  |  |                     </div> | 
 |  |  |                 </div> | 
 |  |  |  | 
 |  |  |       </div> | 
 |  |  |             </div> | 
 |  |  |         </div> | 
 |  |  |         <hr class="layui-bg-gray"> | 
 |  |  |         <div class="layui-form-item text-right"> | 
 |  |  |             <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> | 
 |  |  |     <hr class="layui-bg-gray"> | 
 |  |  |     <div class="layui-form-item text-right"> | 
 |  |  |       <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> | 
 |  |  | </script> | 
 |  |  | </body> | 
 |  |  | </html> | 
 
 |  |  | 
 |  |  | <!DOCTYPE html> | 
 |  |  | <html> | 
 |  |  | <head> | 
 |  |  |   <meta charset="utf-8"> | 
 |  |  |   <title>excel</title> | 
 |  |  |   <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
 |  |  |   <link rel='stylesheet' href='../../static/plugins/css/pluginsCss.css' /> | 
 |  |  |   <link rel='stylesheet' href='../../static/plugins/plugins.css' /> | 
 |  |  |   <link rel='stylesheet' href='../../static/css/luckysheet.css' /> | 
 |  |  |   <link rel='stylesheet' href='../../static/assets/iconfont/iconfont.css' /> | 
 |  |  |   <script src="../../static/js/luckysheet_js/plugin.js"></script> | 
 |  |  |   <script src="../../static/js/luckysheet_js/luckysheet.umd.js"></script> | 
 |  |  |   <script src="../../static/js/luckysheet_js/luckyexcel.umd.js"></script> | 
 |  |  |   <script src="../../static/js/luckysheet_js/exceljs.min.js"></script> | 
 |  |  |   <script type="text/javascript" src="../../static/js/luckysheet_js/export.js" charset="utf-8"></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/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/luckysheet_js/print.min.js" charset="utf-8"></script> | 
 |  |  |     <meta charset="utf-8"> | 
 |  |  |     <title>excel</title> | 
 |  |  |     <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
 |  |  |     <link rel='stylesheet' href='../../static/plugins/css/pluginsCss.css'/> | 
 |  |  |     <link rel='stylesheet' href='../../static/plugins/plugins.css'/> | 
 |  |  |     <link rel='stylesheet' href='../../static/css/luckysheet.css'/> | 
 |  |  |     <link rel='stylesheet' href='../../static/assets/iconfont/iconfont.css'/> | 
 |  |  |     <script src="../../static/js/luckysheet_js/plugin.js"></script> | 
 |  |  |     <script src="../../static/js/luckysheet_js/luckysheet.umd.js"></script> | 
 |  |  |     <script src="../../static/js/luckysheet_js/luckyexcel.umd.js"></script> | 
 |  |  |     <script src="../../static/js/luckysheet_js/exceljs.min.js"></script> | 
 |  |  |     <script type="text/javascript" src="../../static/js/luckysheet_js/export.js" charset="utf-8"></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/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/luckysheet_js/print.min.js" charset="utf-8"></script> | 
 |  |  | </head> | 
 |  |  | <body> | 
 |  |  | <div style="display: flex;position: absolute;top: 20px;left:30px;z-index: 9999;"> | 
 |  |  |   <!--  <div><button type="button" id="export">导出Execel</button></div>--> | 
 |  |  | <!--  <div><button type="button" id="save">保存到服务器</button></div>--> | 
 |  |  | <!--  <div><button type="button" id="otherSave">另保存到服务器</button></div>--> | 
 |  |  |   <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="allprint">全部打印</button></div> | 
 |  |  |   <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="print">选区打印</button></div> | 
 |  |  |   <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="download">下载</button></div> | 
 |  |  |     <!--  <div><button type="button" id="export">导出Execel</button></div>--> | 
 |  |  |     <!--  <div><button type="button" id="save">保存到服务器</button></div>--> | 
 |  |  |     <!--  <div><button type="button" id="otherSave">另保存到服务器</button></div>--> | 
 |  |  |     <div> | 
 |  |  |         <button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="allprint">全部打印</button> | 
 |  |  |     </div> | 
 |  |  |     <div> | 
 |  |  |         <button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="print">选区打印</button> | 
 |  |  |     </div> | 
 |  |  |     <div> | 
 |  |  |         <button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="download">下载</button> | 
 |  |  |     </div> | 
 |  |  | </div> | 
 |  |  | <div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height: 100vh;left: 0px;top: 0px;"></div> | 
 |  |  | <div id="luckysheet" | 
 |  |  |      style="margin:0px;padding:0px;position:absolute;width:100%;height: 100vh;left: 0px;top: 0px;"></div> | 
 |  |  | <script> | 
 |  |  |   $(function () { | 
 |  |  |     var layer = layui.layer; | 
 |  |  |     $(function () { | 
 |  |  |         var layer = layui.layer; | 
 |  |  |  | 
 |  |  |     //配置项 | 
 |  |  |     var options = { | 
 |  |  |       container: 'luckysheet' ,//luckysheet为容器id | 
 |  |  |       title: '查看询价', //工作簿名称 | 
 |  |  |       lang: 'zh', //设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en") | 
 |  |  |       allowEdit: true, //是否允许前台编辑 | 
 |  |  |       sheetFormulaBar: true, //是否显示公式栏 | 
 |  |  |       forceCalculation: true,//强制计算公式 | 
 |  |  |       myFolderUrl: '' //左上角<返回按钮的链接 | 
 |  |  |     } | 
 |  |  |         //配置项 | 
 |  |  |         var options = { | 
 |  |  |             container: 'luckysheet',//luckysheet为容器id | 
 |  |  |             title: '查看询价', //工作簿名称 | 
 |  |  |             lang: 'zh', //设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en") | 
 |  |  |             allowEdit: true, //是否允许前台编辑 | 
 |  |  |             sheetFormulaBar: true, //是否显示公式栏 | 
 |  |  |             forceCalculation: true,//强制计算公式 | 
 |  |  |             myFolderUrl: '' //左上角<返回按钮的链接 | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     let checkDataFile = ""; | 
 |  |  |         let checkDataFile = ""; | 
 |  |  |  | 
 |  |  |     if(getUrlParams('id') == false || getUrlParams('id') == undefined){ | 
 |  |  |       //新增 | 
 |  |  |       luckysheet.create(options) | 
 |  |  |       $("#luckysheet_info_detail_update").hide() | 
 |  |  |       $("#luckysheet_info_detail_save").hide() | 
 |  |  |       $("#luckysheet_info_detail_title").hide() | 
 |  |  |     }else{ | 
 |  |  |       //修改 | 
 |  |  |       $.ajax({ | 
 |  |  |         type:"get", | 
 |  |  |         url: baseUrl + "/priOnline2/viewCheck/" + getUrlParams('id') + "/auth", | 
 |  |  |         dataType:"json", | 
 |  |  |         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |         success:function(res) { | 
 |  |  |           if (res.code == 200) { | 
 |  |  |             checkDataFile = res.data.checkDataFile | 
 |  |  |             options.data = unzip(res.data.checkData) | 
 |  |  |         if (getUrlParams('id') == false || getUrlParams('id') == undefined) { | 
 |  |  |             //新增 | 
 |  |  |             luckysheet.create(options) | 
 |  |  |             $("#luckysheet_info_detail_update").hide() | 
 |  |  |             $("#luckysheet_info_detail_save").hide() | 
 |  |  |             $("#luckysheet_info_detail_title").hide() | 
 |  |  |           }else { | 
 |  |  |             layer.msg(res.msg,{time:1000}) | 
 |  |  |           } | 
 |  |  |         } else { | 
 |  |  |             //修改 | 
 |  |  |             $.ajax({ | 
 |  |  |                 type: "get", | 
 |  |  |                 url: baseUrl + "/priOnline2/viewCheck/" + getUrlParams('id') + "/auth", | 
 |  |  |                 dataType: "json", | 
 |  |  |                 headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                 success: function (res) { | 
 |  |  |                     if (res.code == 200) { | 
 |  |  |                         checkDataFile = res.data.checkDataFile | 
 |  |  |                         options.data = unzip(res.data.checkData) | 
 |  |  |                         luckysheet.create(options) | 
 |  |  |                         $("#luckysheet_info_detail_update").hide() | 
 |  |  |                         $("#luckysheet_info_detail_save").hide() | 
 |  |  |                         $("#luckysheet_info_detail_title").hide() | 
 |  |  |                     } else { | 
 |  |  |                         layer.msg(res.msg, {time: 1000}) | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     $("#export").on("click",() => { | 
 |  |  |       console.log('export') | 
 |  |  |       exportExcel(luckysheet.getluckysheetfile()).then((e) => { | 
 |  |  |         saveFile(e,'file'); | 
 |  |  |       }) | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     //保存到服务器 | 
 |  |  |     $("#save").on("click",() => { | 
 |  |  |       if(getUrlParams('id') == false || getUrlParams('id') == undefined){ | 
 |  |  |         //新增 | 
 |  |  |         $.ajax({ | 
 |  |  |           url: baseUrl + "/priOnline2/add/auth", | 
 |  |  |           headers: {'token': localStorage.getItem('token')}, | 
 |  |  |           data: JSON.stringify({ | 
 |  |  |             title: luckysheet.toJson().title, | 
 |  |  |             sheetData: zip(luckysheet.getAllSheets()), | 
 |  |  |             itemId: getUrlParams('item_id'), | 
 |  |  |             priId: getUrlParams('pri_id') | 
 |  |  |           }), | 
 |  |  |           method: 'POST', | 
 |  |  |           dataType: "json", | 
 |  |  |           contentType:'application/json;charset=UTF-8', | 
 |  |  |           success: function (res) { | 
 |  |  |             if (res.code == 200) { | 
 |  |  |               layer.msg('保存成功',{time:1000},() => { | 
 |  |  |                 parent.location.reload() | 
 |  |  |               }) | 
 |  |  |             }else{ | 
 |  |  |               layer.msg(res.msg,{time:1000}) | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         $("#export").on("click", () => { | 
 |  |  |             console.log('export') | 
 |  |  |             exportExcel(luckysheet.getluckysheetfile()).then((e) => { | 
 |  |  |                 saveFile(e, 'file'); | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |       }else { | 
 |  |  |         //修改 | 
 |  |  |         $.ajax({ | 
 |  |  |           url: baseUrl + "/priOnline2/update/auth", | 
 |  |  |           headers: {'token': localStorage.getItem('token')}, | 
 |  |  |           data: JSON.stringify({ | 
 |  |  |             id: getUrlParams('id'), | 
 |  |  |             title: luckysheet.toJson().title, | 
 |  |  |             sheetData: zip(luckysheet.getAllSheets()) | 
 |  |  |           }), | 
 |  |  |           method: 'POST', | 
 |  |  |           dataType: "json", | 
 |  |  |           contentType:'application/json;charset=UTF-8', | 
 |  |  |           success: function (res) { | 
 |  |  |             if (res.code == 200) { | 
 |  |  |               layer.msg('保存成功',{time:1000},() => { | 
 |  |  |                 parent.location.reload() | 
 |  |  |               }) | 
 |  |  |             }else{ | 
 |  |  |               layer.msg(res.msg,{time:1000}) | 
 |  |  |  | 
 |  |  |         //保存到服务器 | 
 |  |  |         $("#save").on("click", () => { | 
 |  |  |             if (getUrlParams('id') == false || getUrlParams('id') == undefined) { | 
 |  |  |                 //新增 | 
 |  |  |                 $.ajax({ | 
 |  |  |                     url: baseUrl + "/priOnline2/add/auth", | 
 |  |  |                     headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                     data: JSON.stringify({ | 
 |  |  |                         title: luckysheet.toJson().title, | 
 |  |  |                         sheetData: zip(luckysheet.getAllSheets()), | 
 |  |  |                         itemId: getUrlParams('item_id'), | 
 |  |  |                         priId: getUrlParams('pri_id') | 
 |  |  |                     }), | 
 |  |  |                     method: 'POST', | 
 |  |  |                     dataType: "json", | 
 |  |  |                     contentType: 'application/json;charset=UTF-8', | 
 |  |  |                     success: function (res) { | 
 |  |  |                         if (res.code == 200) { | 
 |  |  |                             layer.msg('保存成功', {time: 1000}, () => { | 
 |  |  |                                 parent.location.reload() | 
 |  |  |                             }) | 
 |  |  |                         } else { | 
 |  |  |                             layer.msg(res.msg, {time: 1000}) | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |             } else { | 
 |  |  |                 //修改 | 
 |  |  |                 $.ajax({ | 
 |  |  |                     url: baseUrl + "/priOnline2/update/auth", | 
 |  |  |                     headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                     data: JSON.stringify({ | 
 |  |  |                         id: getUrlParams('id'), | 
 |  |  |                         title: luckysheet.toJson().title, | 
 |  |  |                         sheetData: zip(luckysheet.getAllSheets()) | 
 |  |  |                     }), | 
 |  |  |                     method: 'POST', | 
 |  |  |                     dataType: "json", | 
 |  |  |                     contentType: 'application/json;charset=UTF-8', | 
 |  |  |                     success: function (res) { | 
 |  |  |                         if (res.code == 200) { | 
 |  |  |                             layer.msg('保存成功', {time: 1000}, () => { | 
 |  |  |                                 parent.location.reload() | 
 |  |  |                             }) | 
 |  |  |                         } else { | 
 |  |  |                             layer.msg(res.msg, {time: 1000}) | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         }) | 
 |  |  |       } | 
 |  |  |  | 
 |  |  |         $("#download").on("click", () => { | 
 |  |  |             window.open(baseUrl + "/priOnline2/checkDataDownload/" + checkDataFile) | 
 |  |  |         }) | 
 |  |  |  | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     $("#download").on("click",() => { | 
 |  |  |       window.open(baseUrl + "/priOnline2/checkDataDownload/" +checkDataFile) | 
 |  |  |     $("#allprint").on("click", () => { | 
 |  |  |         printExcel() | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |   }) | 
 |  |  |     $("#print").on("click", () => { | 
 |  |  |         let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |         const style = '@page {margin:0 10mm};' | 
 |  |  |         printJS({ | 
 |  |  |             printable: src, | 
 |  |  |             type: 'image', | 
 |  |  |             style: style | 
 |  |  |         }) // Print.js插件 | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |   $("#allprint").on("click",() => { | 
 |  |  |     printExcel() | 
 |  |  |   }) | 
 |  |  |     // 获取表格中包含内容的row,column | 
 |  |  |     function getExcelRowColumn() { | 
 |  |  |         const sheetData = luckysheet.getSheetData(); | 
 |  |  |         let objRowColumn = { | 
 |  |  |             row: [null, null], //行 | 
 |  |  |             column: [null, null], //列 | 
 |  |  |         }; | 
 |  |  |         sheetData.forEach((item, index) => { | 
 |  |  |             //行数 | 
 |  |  |             item.forEach((it, itemIndex) => { | 
 |  |  |                 if (it !== null) { | 
 |  |  |                     if (objRowColumn.row[0] == null) objRowColumn.row[0] = index; // row第一位 | 
 |  |  |                     objRowColumn.row[1] = index; //row第二位 | 
 |  |  |                     if (objRowColumn.column[0] == null) | 
 |  |  |                         objRowColumn.column[0] = itemIndex; //column第一位 | 
 |  |  |                     objRowColumn.column[1] = itemIndex; //column第二位 | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |         }); | 
 |  |  |         return objRowColumn; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |   $("#print").on("click",() => { | 
 |  |  |     let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |     const style = '@page {margin:0 10mm};' | 
 |  |  |     printJS({ | 
 |  |  |       printable: src, | 
 |  |  |       type: 'image', | 
 |  |  |       style: style | 
 |  |  |     }) // Print.js插件 | 
 |  |  |   }) | 
 |  |  |     function printExcel() { | 
 |  |  |         let RowColumn = this.getExcelRowColumn() // 获取有值的行和列 | 
 |  |  |         RowColumn.column[0] = 0 //因需要打印左边的边框,需重新设置 | 
 |  |  |         luckysheet.setRangeShow(RowColumn) // 进行选区操作 | 
 |  |  |         let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |         const style = '@page {margin:0 10mm};' | 
 |  |  |         printJS({ | 
 |  |  |             printable: src, | 
 |  |  |             type: 'image', | 
 |  |  |             style: style | 
 |  |  |         }) // Print.js插件 | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |   // 获取表格中包含内容的row,column | 
 |  |  |   function getExcelRowColumn() { | 
 |  |  |     const sheetData = luckysheet.getSheetData(); | 
 |  |  |     let objRowColumn = { | 
 |  |  |       row: [null, null], //行 | 
 |  |  |       column: [null, null], //列 | 
 |  |  |     }; | 
 |  |  |     sheetData.forEach((item, index) => { | 
 |  |  |       //行数 | 
 |  |  |       item.forEach((it, itemIndex) => { | 
 |  |  |         if (it !== null) { | 
 |  |  |           if (objRowColumn.row[0] == null) objRowColumn.row[0] = index; // row第一位 | 
 |  |  |           objRowColumn.row[1] = index; //row第二位 | 
 |  |  |           if (objRowColumn.column[0] == null) | 
 |  |  |             objRowColumn.column[0] = itemIndex; //column第一位 | 
 |  |  |           objRowColumn.column[1] = itemIndex; //column第二位 | 
 |  |  |     function getUrlParams(name) { | 
 |  |  |         var url = window.location.search; | 
 |  |  |         if (url.indexOf('?') == -1) { | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |     }); | 
 |  |  |     return objRowColumn; | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   function printExcel() { | 
 |  |  |     let RowColumn = this.getExcelRowColumn() // 获取有值的行和列 | 
 |  |  |     RowColumn.column[0] = 0 //因需要打印左边的边框,需重新设置 | 
 |  |  |     luckysheet.setRangeShow(RowColumn) // 进行选区操作 | 
 |  |  |     let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |     const style = '@page {margin:0 10mm};' | 
 |  |  |     printJS({ | 
 |  |  |       printable: src, | 
 |  |  |       type: 'image', | 
 |  |  |       style: style | 
 |  |  |     }) // Print.js插件 | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   function getUrlParams(name) { | 
 |  |  |     var url = window.location.search; | 
 |  |  |     if (url.indexOf('?') == -1) { return false; } | 
 |  |  |     url = url.substr(1); | 
 |  |  |     url = url.split('&'); | 
 |  |  |     var name = name || ''; | 
 |  |  |     var nameres; | 
 |  |  |     for (var i = 0; i < url.length; i++) { | 
 |  |  |       var info = url[i].split('='); | 
 |  |  |       var obj = {}; | 
 |  |  |       obj[info[0]] = decodeURI(info[1]); | 
 |  |  |       url[i] = obj; | 
 |  |  |     } | 
 |  |  |     if (name) { | 
 |  |  |       for (var i = 0; i < url.length; i++) { | 
 |  |  |         for (var key in url[i]) { | 
 |  |  |           if (key == name) { | 
 |  |  |             nameres = url[i][key]; | 
 |  |  |           } | 
 |  |  |         url = url.substr(1); | 
 |  |  |         url = url.split('&'); | 
 |  |  |         var name = name || ''; | 
 |  |  |         var nameres; | 
 |  |  |         for (var i = 0; i < url.length; i++) { | 
 |  |  |             var info = url[i].split('='); | 
 |  |  |             var obj = {}; | 
 |  |  |             obj[info[0]] = decodeURI(info[1]); | 
 |  |  |             url[i] = obj; | 
 |  |  |         } | 
 |  |  |       } | 
 |  |  |     } else { | 
 |  |  |       nameres = url; | 
 |  |  |         if (name) { | 
 |  |  |             for (var i = 0; i < url.length; i++) { | 
 |  |  |                 for (var key in url[i]) { | 
 |  |  |                     if (key == name) { | 
 |  |  |                         nameres = url[i][key]; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } else { | 
 |  |  |             nameres = url; | 
 |  |  |         } | 
 |  |  |         return nameres; | 
 |  |  |     } | 
 |  |  |     return nameres; | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   // 压缩 | 
 |  |  |   function zip(data) { | 
 |  |  |     if (!data) return data | 
 |  |  |     // 判断数据是否需要转为JSON | 
 |  |  |     const dataJson = typeof data !== 'string' && typeof data !== 'number' ? JSON.stringify(data) : data | 
 |  |  |     // 压缩 | 
 |  |  |     function zip(data) { | 
 |  |  |         if (!data) return data | 
 |  |  |         // 判断数据是否需要转为JSON | 
 |  |  |         const dataJson = typeof data !== 'string' && typeof data !== 'number' ? JSON.stringify(data) : data | 
 |  |  |  | 
 |  |  |     // 使用Base64.encode处理字符编码,兼容中文 | 
 |  |  |     const str = Base64.encode(dataJson) | 
 |  |  |     let binaryString = pako.gzip(str); | 
 |  |  |     let arr = Array.from(binaryString); | 
 |  |  |     let s = ""; | 
 |  |  |     arr.forEach((item, index) => { | 
 |  |  |       s += String.fromCharCode(item) | 
 |  |  |     }) | 
 |  |  |     return btoa(s) | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   // 解压 | 
 |  |  |   function unzip(b64Data) { | 
 |  |  |     let strData = atob(b64Data); | 
 |  |  |     let charData = strData.split('').map(function (x) { | 
 |  |  |       return x.charCodeAt(0); | 
 |  |  |     }); | 
 |  |  |     let binData = new Uint8Array(charData); | 
 |  |  |     let data = pako.ungzip(binData); | 
 |  |  |  | 
 |  |  |     // ↓切片处理数据,防止内存溢出报错↓ | 
 |  |  |     let str = ''; | 
 |  |  |     const chunk = 8 * 1024 | 
 |  |  |     let i; | 
 |  |  |     for (i = 0; i < data.length / chunk; i++) { | 
 |  |  |       str += String.fromCharCode.apply(null, data.slice(i * chunk, (i + 1) * chunk)); | 
 |  |  |         // 使用Base64.encode处理字符编码,兼容中文 | 
 |  |  |         const str = Base64.encode(dataJson) | 
 |  |  |         let binaryString = pako.gzip(str); | 
 |  |  |         let arr = Array.from(binaryString); | 
 |  |  |         let s = ""; | 
 |  |  |         arr.forEach((item, index) => { | 
 |  |  |             s += String.fromCharCode(item) | 
 |  |  |         }) | 
 |  |  |         return btoa(s) | 
 |  |  |     } | 
 |  |  |     str += String.fromCharCode.apply(null, data.slice(i * chunk)); | 
 |  |  |     // ↑切片处理数据,防止内存溢出报错↑ | 
 |  |  |  | 
 |  |  |     const unzipStr = Base64.decode(str); | 
 |  |  |     let result = '' | 
 |  |  |     // 解压 | 
 |  |  |     function unzip(b64Data) { | 
 |  |  |         let strData = atob(b64Data); | 
 |  |  |         let charData = strData.split('').map(function (x) { | 
 |  |  |             return x.charCodeAt(0); | 
 |  |  |         }); | 
 |  |  |         let binData = new Uint8Array(charData); | 
 |  |  |         let data = pako.ungzip(binData); | 
 |  |  |  | 
 |  |  |     // 对象或数组进行JSON转换 | 
 |  |  |     try { | 
 |  |  |       result = JSON.parse(unzipStr) | 
 |  |  |     } catch (error) { | 
 |  |  |       if (/Unexpected token o in JSON at position 0/.test(error)) { | 
 |  |  |         // 如果没有转换成功,代表值为基本数据,直接赋值 | 
 |  |  |         result = unzipStr | 
 |  |  |       } | 
 |  |  |         // ↓切片处理数据,防止内存溢出报错↓ | 
 |  |  |         let str = ''; | 
 |  |  |         const chunk = 8 * 1024 | 
 |  |  |         let i; | 
 |  |  |         for (i = 0; i < data.length / chunk; i++) { | 
 |  |  |             str += String.fromCharCode.apply(null, data.slice(i * chunk, (i + 1) * chunk)); | 
 |  |  |         } | 
 |  |  |         str += String.fromCharCode.apply(null, data.slice(i * chunk)); | 
 |  |  |         // ↑切片处理数据,防止内存溢出报错↑ | 
 |  |  |  | 
 |  |  |         const unzipStr = Base64.decode(str); | 
 |  |  |         let result = '' | 
 |  |  |  | 
 |  |  |         // 对象或数组进行JSON转换 | 
 |  |  |         try { | 
 |  |  |             result = JSON.parse(unzipStr) | 
 |  |  |         } catch (error) { | 
 |  |  |             if (/Unexpected token o in JSON at position 0/.test(error)) { | 
 |  |  |                 // 如果没有转换成功,代表值为基本数据,直接赋值 | 
 |  |  |                 result = unzipStr | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         return result | 
 |  |  |     } | 
 |  |  |     return result | 
 |  |  |   } | 
 |  |  | </script> | 
 |  |  | </body> | 
 |  |  | </html> | 
 
 |  |  | 
 |  |  | <!DOCTYPE html> | 
 |  |  | <html> | 
 |  |  | <head> | 
 |  |  |   <meta charset="utf-8"> | 
 |  |  |   <title>excel</title> | 
 |  |  |   <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
 |  |  |   <link rel='stylesheet' href='../../static/plugins/css/pluginsCss.css' /> | 
 |  |  |   <link rel='stylesheet' href='../../static/plugins/plugins.css' /> | 
 |  |  |   <link rel='stylesheet' href='../../static/css/luckysheet.css' /> | 
 |  |  |   <link rel='stylesheet' href='../../static/assets/iconfont/iconfont.css' /> | 
 |  |  |   <script src="../../static/js/luckysheet_js/plugin.js"></script> | 
 |  |  |   <script src="../../static/js/luckysheet_js/luckysheet.umd.js"></script> | 
 |  |  |   <script src="../../static/js/luckysheet_js/luckyexcel.umd.js"></script> | 
 |  |  |   <script src="../../static/js/luckysheet_js/exceljs.min.js"></script> | 
 |  |  |   <script type="text/javascript" src="../../static/js/luckysheet_js/export.js" charset="utf-8"></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/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/luckysheet_js/print.min.js" charset="utf-8"></script> | 
 |  |  |     <meta charset="utf-8"> | 
 |  |  |     <title>excel</title> | 
 |  |  |     <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> | 
 |  |  |     <link rel='stylesheet' href='../../static/plugins/css/pluginsCss.css'/> | 
 |  |  |     <link rel='stylesheet' href='../../static/plugins/plugins.css'/> | 
 |  |  |     <link rel='stylesheet' href='../../static/css/luckysheet.css'/> | 
 |  |  |     <link rel='stylesheet' href='../../static/assets/iconfont/iconfont.css'/> | 
 |  |  |     <script src="../../static/js/luckysheet_js/plugin.js"></script> | 
 |  |  |     <script src="../../static/js/luckysheet_js/luckysheet.umd.js"></script> | 
 |  |  |     <script src="../../static/js/luckysheet_js/luckyexcel.umd.js"></script> | 
 |  |  |     <script src="../../static/js/luckysheet_js/exceljs.min.js"></script> | 
 |  |  |     <script type="text/javascript" src="../../static/js/luckysheet_js/export.js" charset="utf-8"></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/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/luckysheet_js/print.min.js" charset="utf-8"></script> | 
 |  |  | </head> | 
 |  |  | <body> | 
 |  |  | <div style="display: flex;position: absolute;top: 20px;left:30px;z-index: 9999;"> | 
 |  |  | <!--  <div>上传Execel:<input type="file" id="Luckyexcel-demo-file" /></div>--> | 
 |  |  | <!--  <div><button type="button" id="export">导出Execel</button></div>--> | 
 |  |  |   <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="save">保存</button></div> | 
 |  |  |   <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="otherSave">另存为</button></div> | 
 |  |  |   <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="allprint">全部打印</button></div> | 
 |  |  |   <div><button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="print">选区打印</button></div> | 
 |  |  |     <!--  <div>上传Execel:<input type="file" id="Luckyexcel-demo-file" /></div>--> | 
 |  |  |     <!--  <div><button type="button" id="export">导出Execel</button></div>--> | 
 |  |  |     <div> | 
 |  |  |         <button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="save">保存</button> | 
 |  |  |     </div> | 
 |  |  |     <div> | 
 |  |  |         <button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="otherSave">另存为</button> | 
 |  |  |     </div> | 
 |  |  |     <div> | 
 |  |  |         <button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="allprint">全部打印</button> | 
 |  |  |     </div> | 
 |  |  |     <div> | 
 |  |  |         <button type="button" class="layui-btn layui-btn-primary layui-btn-xs btn-edit" id="print">选区打印</button> | 
 |  |  |     </div> | 
 |  |  | </div> | 
 |  |  | <div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height: 100vh;left: 0px;top: 0px;"></div> | 
 |  |  | <div id="luckysheet" | 
 |  |  |      style="margin:0px;padding:0px;position:absolute;width:100%;height: 100vh;left: 0px;top: 0px;"></div> | 
 |  |  | <script> | 
 |  |  |   $(function () { | 
 |  |  |     var layer = layui.layer; | 
 |  |  |     $(function () { | 
 |  |  |         var layer = layui.layer; | 
 |  |  |  | 
 |  |  |     //配置项 | 
 |  |  |     var options = { | 
 |  |  |       container: 'luckysheet' ,//luckysheet为容器id | 
 |  |  |       title: '在线核价', //工作簿名称 | 
 |  |  |       lang: 'zh', //设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en") | 
 |  |  |       allowEdit: true, //是否允许前台编辑 | 
 |  |  |       sheetFormulaBar: true, //是否显示公式栏 | 
 |  |  |       forceCalculation: true,//强制计算公式 | 
 |  |  |       myFolderUrl: '' //左上角<返回按钮的链接 | 
 |  |  |     } | 
 |  |  |         //配置项 | 
 |  |  |         var options = { | 
 |  |  |             container: 'luckysheet',//luckysheet为容器id | 
 |  |  |             title: '在线核价', //工作簿名称 | 
 |  |  |             lang: 'zh', //设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en") | 
 |  |  |             allowEdit: true, //是否允许前台编辑 | 
 |  |  |             sheetFormulaBar: true, //是否显示公式栏 | 
 |  |  |             forceCalculation: true,//强制计算公式 | 
 |  |  |             myFolderUrl: '', //左上角<返回按钮的链接 | 
 |  |  |             allowEdit: true // 是否允许前台编辑 | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |     if(getUrlParams('id') == false || getUrlParams('id') == undefined){ | 
 |  |  |       //新增 | 
 |  |  |       if(getUrlParams('template') == false || getUrlParams('template') == undefined){ | 
 |  |  |         luckysheet.create(options) | 
 |  |  |         $("#luckysheet_info_detail_update").hide() | 
 |  |  |         $("#luckysheet_info_detail_save").hide() | 
 |  |  |         $("#luckysheet_info_detail_title").hide() | 
 |  |  |       }else { | 
 |  |  |         $.ajax({ | 
 |  |  |           type:"get", | 
 |  |  |           url: baseUrl + "/static/js/priOnline2/data" + getUrlParams('template') + ".txt", | 
 |  |  |           success:function(sheetData) { | 
 |  |  |             options.data = unzip(sheetData) | 
 |  |  |             options.title = getUrlParams('name') | 
 |  |  |             luckysheet.create(options) | 
 |  |  |             $("#luckysheet_info_detail_update").hide() | 
 |  |  |             $("#luckysheet_info_detail_save").hide() | 
 |  |  |             $("#luckysheet_info_detail_title").hide() | 
 |  |  |           } | 
 |  |  |         if (getUrlParams('id') == false || getUrlParams('id') == undefined) { | 
 |  |  |             //新增 | 
 |  |  |             if (getUrlParams('template') == false || getUrlParams('template') == undefined) { | 
 |  |  |                 luckysheet.create(options) | 
 |  |  |                 $("#luckysheet_info_detail_update").hide() | 
 |  |  |                 $("#luckysheet_info_detail_save").hide() | 
 |  |  |                 $("#luckysheet_info_detail_title").hide() | 
 |  |  |             } else { | 
 |  |  |                 $.ajax({ | 
 |  |  |                     type: "get", | 
 |  |  |                     url: baseUrl + "/static/js/priOnline2/data" + getUrlParams('template') + ".txt", | 
 |  |  |                     success: function (sheetData) { | 
 |  |  |                         options.data = unzip(sheetData) | 
 |  |  |                         options.title = getUrlParams('name') | 
 |  |  |                         luckysheet.create(options) | 
 |  |  |                         $("#luckysheet_info_detail_update").hide() | 
 |  |  |                         $("#luckysheet_info_detail_save").hide() | 
 |  |  |                         $("#luckysheet_info_detail_title").hide() | 
 |  |  |                     } | 
 |  |  |                 }); | 
 |  |  |             } | 
 |  |  |         } else { | 
 |  |  |             //修改 | 
 |  |  |             $.ajax({ | 
 |  |  |                 type: "get", | 
 |  |  |                 url: baseUrl + "/priOnline2/" + getUrlParams('id') + "/auth", | 
 |  |  |                 dataType: "json", | 
 |  |  |                 headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                 success: function (res) { | 
 |  |  |                     options.data = unzip(res.data.sheetData) | 
 |  |  |                     options.title = res.data.title | 
 |  |  |                     luckysheet.create(options) | 
 |  |  |                     $("#luckysheet_info_detail_update").hide() | 
 |  |  |                     $("#luckysheet_info_detail_save").hide() | 
 |  |  |                     $("#luckysheet_info_detail_title").hide() | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         $("#Luckyexcel-demo-file").on("change", (evt) => { | 
 |  |  |             var files = evt.target.files; | 
 |  |  |             if (files == null || files.length == 0) { | 
 |  |  |                 alert("No files wait for import"); | 
 |  |  |                 return; | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             let name = files[0].name; | 
 |  |  |             let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length - 1]; | 
 |  |  |             if (suffix != "xlsx") { | 
 |  |  |                 alert("Currently only supports the import of xlsx files"); | 
 |  |  |                 return; | 
 |  |  |             } | 
 |  |  |             LuckyExcel.transformExcelToLucky(files[0], function (exportJson, luckysheetfile) { | 
 |  |  |  | 
 |  |  |                 if (exportJson.sheets == null || exportJson.sheets.length == 0) { | 
 |  |  |                     alert("Failed to read the content of the excel file, currently does not support xls files!"); | 
 |  |  |                     return; | 
 |  |  |                 } | 
 |  |  |                 window.luckysheet.destroy(); | 
 |  |  |  | 
 |  |  |                 window.luckysheet.create({ | 
 |  |  |                     container: 'luckysheet', //luckysheet is the container id | 
 |  |  |                     data: exportJson.sheets, | 
 |  |  |                     title: exportJson.info.name, | 
 |  |  |                     userInfo: exportJson.info.name.creator, | 
 |  |  |                     lang: 'zh', //设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en") | 
 |  |  |                     allowEdit: true, //是否允许前台编辑 | 
 |  |  |                     sheetFormulaBar: true, //是否显示公式栏 | 
 |  |  |                     forceCalculation: true,//强制计算公式 | 
 |  |  |                 }); | 
 |  |  |             }); | 
 |  |  |         }) | 
 |  |  |  | 
 |  |  |         $("#export").on("click", () => { | 
 |  |  |             console.log('export') | 
 |  |  |             exportExcel(luckysheet.getluckysheetfile()).then((e) => { | 
 |  |  |                 saveFile(e, 'file'); | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |  | 
 |  |  |         //保存到服务器 | 
 |  |  |         $("#save").on("click", () => { | 
 |  |  |             if (getUrlParams('id') == false || getUrlParams('id') == undefined) { | 
 |  |  |                 //新增 | 
 |  |  |                 $.ajax({ | 
 |  |  |                     url: baseUrl + "/priOnline2/add/auth", | 
 |  |  |                     headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                     data: JSON.stringify({ | 
 |  |  |                         title: luckysheet.toJson().title, | 
 |  |  |                         sheetData: zip(luckysheet.getAllSheets()), | 
 |  |  |                         itemId: getUrlParams('item_id'), | 
 |  |  |                         priId: getUrlParams('pri_id') | 
 |  |  |                     }), | 
 |  |  |                     method: 'POST', | 
 |  |  |                     dataType: "json", | 
 |  |  |                     contentType: 'application/json;charset=UTF-8', | 
 |  |  |                     success: function (res) { | 
 |  |  |                         if (res.code == 200) { | 
 |  |  |                             layer.msg('保存成功', {time: 1000}, () => { | 
 |  |  |                                 parent.location.reload() | 
 |  |  |                             }) | 
 |  |  |                         } else { | 
 |  |  |                             layer.msg(res.msg, {time: 1000}) | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |             } else { | 
 |  |  |                 //修改 | 
 |  |  |                 $.ajax({ | 
 |  |  |                     url: baseUrl + "/priOnline2/update/auth", | 
 |  |  |                     headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                     data: JSON.stringify({ | 
 |  |  |                         id: getUrlParams('id'), | 
 |  |  |                         title: luckysheet.toJson().title, | 
 |  |  |                         sheetData: zip(luckysheet.getAllSheets()) | 
 |  |  |                     }), | 
 |  |  |                     method: 'POST', | 
 |  |  |                     dataType: "json", | 
 |  |  |                     contentType: 'application/json;charset=UTF-8', | 
 |  |  |                     success: function (res) { | 
 |  |  |                         if (res.code == 200) { | 
 |  |  |                             layer.msg('保存成功', {time: 1000}, () => { | 
 |  |  |                                 parent.location.reload() | 
 |  |  |                             }) | 
 |  |  |                         } else { | 
 |  |  |                             layer.msg(res.msg, {time: 1000}) | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |             } | 
 |  |  |         }) | 
 |  |  |  | 
 |  |  |         $("#otherSave").on("click", () => { | 
 |  |  |             if (getUrlParams('id') == false || getUrlParams('id') == undefined) { | 
 |  |  |                 //新建文件 | 
 |  |  |                 $("#save").trigger("click") | 
 |  |  |             } else { | 
 |  |  |                 //另存 | 
 |  |  |                 $.ajax({ | 
 |  |  |                     url: baseUrl + "/priOnline2/addOther/auth", | 
 |  |  |                     headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                     data: JSON.stringify({ | 
 |  |  |                         id: getUrlParams('id'), | 
 |  |  |                         title: luckysheet.toJson().title, | 
 |  |  |                         sheetData: zip(luckysheet.getAllSheets()) | 
 |  |  |                     }), | 
 |  |  |                     method: 'POST', | 
 |  |  |                     dataType: "json", | 
 |  |  |                     contentType: 'application/json;charset=UTF-8', | 
 |  |  |                     success: function (res) { | 
 |  |  |                         if (res.code == 200) { | 
 |  |  |                             layer.msg('另存成功', {time: 1000}, () => { | 
 |  |  |                                 parent.location.reload() | 
 |  |  |                             }) | 
 |  |  |                         } else { | 
 |  |  |                             layer.msg('保存失败', {time: 1000}) | 
 |  |  |                         } | 
 |  |  |                     } | 
 |  |  |                 }) | 
 |  |  |             } | 
 |  |  |         }) | 
 |  |  |  | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     $("#allprint").on("click", () => { | 
 |  |  |         printExcel() | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     $("#print").on("click", () => { | 
 |  |  |         let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |         const style = '@page {margin:0 10mm};' | 
 |  |  |         printJS({ | 
 |  |  |             printable: src, | 
 |  |  |             type: 'image', | 
 |  |  |             style: style | 
 |  |  |         }) // Print.js插件 | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     // 获取表格中包含内容的row,column | 
 |  |  |     function getExcelRowColumn() { | 
 |  |  |         const sheetData = luckysheet.getSheetData(); | 
 |  |  |         let objRowColumn = { | 
 |  |  |             row: [null, null], //行 | 
 |  |  |             column: [null, null], //列 | 
 |  |  |         }; | 
 |  |  |         sheetData.forEach((item, index) => { | 
 |  |  |             //行数 | 
 |  |  |             item.forEach((it, itemIndex) => { | 
 |  |  |                 if (it !== null) { | 
 |  |  |                     if (objRowColumn.row[0] == null) objRowColumn.row[0] = index; // row第一位 | 
 |  |  |                     objRowColumn.row[1] = index; //row第二位 | 
 |  |  |                     if (objRowColumn.column[0] == null) | 
 |  |  |                         objRowColumn.column[0] = itemIndex; //column第一位 | 
 |  |  |                     objRowColumn.column[1] = itemIndex; //column第二位 | 
 |  |  |                 } | 
 |  |  |             }); | 
 |  |  |         }); | 
 |  |  |       } | 
 |  |  |     }else{ | 
 |  |  |       //修改 | 
 |  |  |       $.ajax({ | 
 |  |  |         type:"get", | 
 |  |  |         url: baseUrl + "/priOnline2/" + getUrlParams('id') + "/auth", | 
 |  |  |         dataType:"json", | 
 |  |  |         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |         success:function(res) { | 
 |  |  |           options.data = unzip(res.data.sheetData) | 
 |  |  |           options.title = res.data.title | 
 |  |  |           luckysheet.create(options) | 
 |  |  |           $("#luckysheet_info_detail_update").hide() | 
 |  |  |           $("#luckysheet_info_detail_save").hide() | 
 |  |  |           $("#luckysheet_info_detail_title").hide() | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |  | 
 |  |  |         return objRowColumn; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     $("#Luckyexcel-demo-file").on("change",(evt) => { | 
 |  |  |       var files = evt.target.files; | 
 |  |  |       if(files==null || files.length==0){ | 
 |  |  |         alert("No files wait for import"); | 
 |  |  |         return; | 
 |  |  |       } | 
 |  |  |     function printExcel() { | 
 |  |  |         let RowColumn = this.getExcelRowColumn() // 获取有值的行和列 | 
 |  |  |         RowColumn.column[0] = 0 //因需要打印左边的边框,需重新设置 | 
 |  |  |         luckysheet.setRangeShow(RowColumn) // 进行选区操作 | 
 |  |  |         let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |         const style = '@page {margin:0 10mm};' | 
 |  |  |         printJS({ | 
 |  |  |             printable: src, | 
 |  |  |             type: 'image', | 
 |  |  |             style: style | 
 |  |  |         }) // Print.js插件 | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |       let name = files[0].name; | 
 |  |  |       let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length-1]; | 
 |  |  |       if(suffix!="xlsx"){ | 
 |  |  |         alert("Currently only supports the import of xlsx files"); | 
 |  |  |         return; | 
 |  |  |       } | 
 |  |  |       LuckyExcel.transformExcelToLucky(files[0], function(exportJson, luckysheetfile){ | 
 |  |  |  | 
 |  |  |         if(exportJson.sheets==null || exportJson.sheets.length==0){ | 
 |  |  |           alert("Failed to read the content of the excel file, currently does not support xls files!"); | 
 |  |  |           return; | 
 |  |  |     function getUrlParams(name) { | 
 |  |  |         var url = window.location.search; | 
 |  |  |         if (url.indexOf('?') == -1) { | 
 |  |  |             return false; | 
 |  |  |         } | 
 |  |  |         window.luckysheet.destroy(); | 
 |  |  |         url = url.substr(1); | 
 |  |  |         url = url.split('&'); | 
 |  |  |         var name = name || ''; | 
 |  |  |         var nameres; | 
 |  |  |         for (var i = 0; i < url.length; i++) { | 
 |  |  |             var info = url[i].split('='); | 
 |  |  |             var obj = {}; | 
 |  |  |             obj[info[0]] = decodeURI(info[1]); | 
 |  |  |             url[i] = obj; | 
 |  |  |         } | 
 |  |  |         if (name) { | 
 |  |  |             for (var i = 0; i < url.length; i++) { | 
 |  |  |                 for (var key in url[i]) { | 
 |  |  |                     if (key == name) { | 
 |  |  |                         nameres = url[i][key]; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |         } else { | 
 |  |  |             nameres = url; | 
 |  |  |         } | 
 |  |  |         return nameres; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |         window.luckysheet.create({ | 
 |  |  |           container: 'luckysheet', //luckysheet is the container id | 
 |  |  |           data:exportJson.sheets, | 
 |  |  |           title:exportJson.info.name, | 
 |  |  |           userInfo:exportJson.info.name.creator, | 
 |  |  |           lang: 'zh', //设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en") | 
 |  |  |           allowEdit: true, //是否允许前台编辑 | 
 |  |  |           sheetFormulaBar: true, //是否显示公式栏 | 
 |  |  |           forceCalculation: true,//强制计算公式 | 
 |  |  |     // 压缩 | 
 |  |  |     function zip(data) { | 
 |  |  |         if (!data) return data | 
 |  |  |         // 判断数据是否需要转为JSON | 
 |  |  |         const dataJson = typeof data !== 'string' && typeof data !== 'number' ? JSON.stringify(data) : data | 
 |  |  |  | 
 |  |  |         // 使用Base64.encode处理字符编码,兼容中文 | 
 |  |  |         const str = Base64.encode(dataJson) | 
 |  |  |         let binaryString = pako.gzip(str); | 
 |  |  |         let arr = Array.from(binaryString); | 
 |  |  |         let s = ""; | 
 |  |  |         arr.forEach((item, index) => { | 
 |  |  |             s += String.fromCharCode(item) | 
 |  |  |         }) | 
 |  |  |         return btoa(s) | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // 解压 | 
 |  |  |     function unzip(b64Data) { | 
 |  |  |         let strData = atob(b64Data); | 
 |  |  |         let charData = strData.split('').map(function (x) { | 
 |  |  |             return x.charCodeAt(0); | 
 |  |  |         }); | 
 |  |  |       }); | 
 |  |  |     }) | 
 |  |  |         let binData = new Uint8Array(charData); | 
 |  |  |         let data = pako.ungzip(binData); | 
 |  |  |  | 
 |  |  |     $("#export").on("click",() => { | 
 |  |  |       console.log('export') | 
 |  |  |       exportExcel(luckysheet.getluckysheetfile()).then((e) => { | 
 |  |  |         saveFile(e,'file'); | 
 |  |  |       }) | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     //保存到服务器 | 
 |  |  |     $("#save").on("click",() => { | 
 |  |  |       if(getUrlParams('id') == false || getUrlParams('id') == undefined){ | 
 |  |  |         //新增 | 
 |  |  |         $.ajax({ | 
 |  |  |           url: baseUrl + "/priOnline2/add/auth", | 
 |  |  |           headers: {'token': localStorage.getItem('token')}, | 
 |  |  |           data: JSON.stringify({ | 
 |  |  |             title: luckysheet.toJson().title, | 
 |  |  |             sheetData: zip(luckysheet.getAllSheets()), | 
 |  |  |             itemId: getUrlParams('item_id'), | 
 |  |  |             priId: getUrlParams('pri_id') | 
 |  |  |           }), | 
 |  |  |           method: 'POST', | 
 |  |  |           dataType: "json", | 
 |  |  |           contentType:'application/json;charset=UTF-8', | 
 |  |  |           success: function (res) { | 
 |  |  |             if (res.code == 200) { | 
 |  |  |               layer.msg('保存成功',{time:1000},() => { | 
 |  |  |                 parent.location.reload() | 
 |  |  |               }) | 
 |  |  |             }else{ | 
 |  |  |               layer.msg(res.msg,{time:1000}) | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         }) | 
 |  |  |       }else { | 
 |  |  |         //修改 | 
 |  |  |         $.ajax({ | 
 |  |  |           url: baseUrl + "/priOnline2/update/auth", | 
 |  |  |           headers: {'token': localStorage.getItem('token')}, | 
 |  |  |           data: JSON.stringify({ | 
 |  |  |             id: getUrlParams('id'), | 
 |  |  |             title: luckysheet.toJson().title, | 
 |  |  |             sheetData: zip(luckysheet.getAllSheets()) | 
 |  |  |           }), | 
 |  |  |           method: 'POST', | 
 |  |  |           dataType: "json", | 
 |  |  |           contentType:'application/json;charset=UTF-8', | 
 |  |  |           success: function (res) { | 
 |  |  |             if (res.code == 200) { | 
 |  |  |               layer.msg('保存成功',{time:1000},() => { | 
 |  |  |                 parent.location.reload() | 
 |  |  |               }) | 
 |  |  |             }else{ | 
 |  |  |               layer.msg(res.msg,{time:1000}) | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         }) | 
 |  |  |       } | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |     $("#otherSave").on("click",() => { | 
 |  |  |       if(getUrlParams('id') == false || getUrlParams('id') == undefined){ | 
 |  |  |         //新建文件 | 
 |  |  |         $("#save").trigger("click") | 
 |  |  |       }else { | 
 |  |  |         //另存 | 
 |  |  |         $.ajax({ | 
 |  |  |           url: baseUrl + "/priOnline2/addOther/auth", | 
 |  |  |           headers: {'token': localStorage.getItem('token')}, | 
 |  |  |           data: JSON.stringify({ | 
 |  |  |             id: getUrlParams('id'), | 
 |  |  |             title: luckysheet.toJson().title, | 
 |  |  |             sheetData: zip(luckysheet.getAllSheets()) | 
 |  |  |           }), | 
 |  |  |           method: 'POST', | 
 |  |  |           dataType: "json", | 
 |  |  |           contentType:'application/json;charset=UTF-8', | 
 |  |  |           success: function (res) { | 
 |  |  |             if (res.code == 200) { | 
 |  |  |               layer.msg('另存成功',{time:1000},() => { | 
 |  |  |                 parent.location.reload() | 
 |  |  |               }) | 
 |  |  |             }else{ | 
 |  |  |               layer.msg('保存失败',{time:1000}) | 
 |  |  |             } | 
 |  |  |           } | 
 |  |  |         }) | 
 |  |  |       } | 
 |  |  |     }) | 
 |  |  |  | 
 |  |  |   }) | 
 |  |  |  | 
 |  |  |   $("#allprint").on("click",() => { | 
 |  |  |     printExcel() | 
 |  |  |   }) | 
 |  |  |  | 
 |  |  |   $("#print").on("click",() => { | 
 |  |  |     let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |     const style = '@page {margin:0 10mm};' | 
 |  |  |     printJS({ | 
 |  |  |       printable: src, | 
 |  |  |       type: 'image', | 
 |  |  |       style: style | 
 |  |  |     }) // Print.js插件 | 
 |  |  |   }) | 
 |  |  |  | 
 |  |  |   // 获取表格中包含内容的row,column | 
 |  |  |   function getExcelRowColumn() { | 
 |  |  |     const sheetData = luckysheet.getSheetData(); | 
 |  |  |     let objRowColumn = { | 
 |  |  |       row: [null, null], //行 | 
 |  |  |       column: [null, null], //列 | 
 |  |  |     }; | 
 |  |  |     sheetData.forEach((item, index) => { | 
 |  |  |       //行数 | 
 |  |  |       item.forEach((it, itemIndex) => { | 
 |  |  |         if (it !== null) { | 
 |  |  |           if (objRowColumn.row[0] == null) objRowColumn.row[0] = index; // row第一位 | 
 |  |  |           objRowColumn.row[1] = index; //row第二位 | 
 |  |  |           if (objRowColumn.column[0] == null) | 
 |  |  |             objRowColumn.column[0] = itemIndex; //column第一位 | 
 |  |  |           objRowColumn.column[1] = itemIndex; //column第二位 | 
 |  |  |         // ↓切片处理数据,防止内存溢出报错↓ | 
 |  |  |         let str = ''; | 
 |  |  |         const chunk = 8 * 1024 | 
 |  |  |         let i; | 
 |  |  |         for (i = 0; i < data.length / chunk; i++) { | 
 |  |  |             str += String.fromCharCode.apply(null, data.slice(i * chunk, (i + 1) * chunk)); | 
 |  |  |         } | 
 |  |  |       }); | 
 |  |  |     }); | 
 |  |  |     return objRowColumn; | 
 |  |  |   } | 
 |  |  |         str += String.fromCharCode.apply(null, data.slice(i * chunk)); | 
 |  |  |         // ↑切片处理数据,防止内存溢出报错↑ | 
 |  |  |  | 
 |  |  |   function printExcel() { | 
 |  |  |     let RowColumn = this.getExcelRowColumn() // 获取有值的行和列 | 
 |  |  |     RowColumn.column[0] = 0 //因需要打印左边的边框,需重新设置 | 
 |  |  |     luckysheet.setRangeShow(RowColumn) // 进行选区操作 | 
 |  |  |     let src = luckysheet.getScreenshot(); // 生成base64图片 | 
 |  |  |     const style = '@page {margin:0 10mm};' | 
 |  |  |     printJS({ | 
 |  |  |       printable: src, | 
 |  |  |       type: 'image', | 
 |  |  |       style: style | 
 |  |  |     }) // Print.js插件 | 
 |  |  |   } | 
 |  |  |         const unzipStr = Base64.decode(str); | 
 |  |  |         let result = '' | 
 |  |  |  | 
 |  |  |   function getUrlParams(name) { | 
 |  |  |     var url = window.location.search; | 
 |  |  |     if (url.indexOf('?') == -1) { return false; } | 
 |  |  |     url = url.substr(1); | 
 |  |  |     url = url.split('&'); | 
 |  |  |     var name = name || ''; | 
 |  |  |     var nameres; | 
 |  |  |     for (var i = 0; i < url.length; i++) { | 
 |  |  |       var info = url[i].split('='); | 
 |  |  |       var obj = {}; | 
 |  |  |       obj[info[0]] = decodeURI(info[1]); | 
 |  |  |       url[i] = obj; | 
 |  |  |     } | 
 |  |  |     if (name) { | 
 |  |  |       for (var i = 0; i < url.length; i++) { | 
 |  |  |         for (var key in url[i]) { | 
 |  |  |           if (key == name) { | 
 |  |  |             nameres = url[i][key]; | 
 |  |  |           } | 
 |  |  |         // 对象或数组进行JSON转换 | 
 |  |  |         try { | 
 |  |  |             result = JSON.parse(unzipStr) | 
 |  |  |         } catch (error) { | 
 |  |  |             if (/Unexpected token o in JSON at position 0/.test(error)) { | 
 |  |  |                 // 如果没有转换成功,代表值为基本数据,直接赋值 | 
 |  |  |                 result = unzipStr | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |       } | 
 |  |  |     } else { | 
 |  |  |       nameres = url; | 
 |  |  |         return result | 
 |  |  |     } | 
 |  |  |     return nameres; | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   // 压缩 | 
 |  |  |   function zip(data) { | 
 |  |  |     if (!data) return data | 
 |  |  |     // 判断数据是否需要转为JSON | 
 |  |  |     const dataJson = typeof data !== 'string' && typeof data !== 'number' ? JSON.stringify(data) : data | 
 |  |  |  | 
 |  |  |     // 使用Base64.encode处理字符编码,兼容中文 | 
 |  |  |     const str = Base64.encode(dataJson) | 
 |  |  |     let binaryString = pako.gzip(str); | 
 |  |  |     let arr = Array.from(binaryString); | 
 |  |  |     let s = ""; | 
 |  |  |     arr.forEach((item, index) => { | 
 |  |  |       s += String.fromCharCode(item) | 
 |  |  |     }) | 
 |  |  |     return btoa(s) | 
 |  |  |   } | 
 |  |  |  | 
 |  |  |   // 解压 | 
 |  |  |   function unzip(b64Data) { | 
 |  |  |     let strData = atob(b64Data); | 
 |  |  |     let charData = strData.split('').map(function (x) { | 
 |  |  |       return x.charCodeAt(0); | 
 |  |  |     }); | 
 |  |  |     let binData = new Uint8Array(charData); | 
 |  |  |     let data = pako.ungzip(binData); | 
 |  |  |  | 
 |  |  |     // ↓切片处理数据,防止内存溢出报错↓ | 
 |  |  |     let str = ''; | 
 |  |  |     const chunk = 8 * 1024 | 
 |  |  |     let i; | 
 |  |  |     for (i = 0; i < data.length / chunk; i++) { | 
 |  |  |       str += String.fromCharCode.apply(null, data.slice(i * chunk, (i + 1) * chunk)); | 
 |  |  |     } | 
 |  |  |     str += String.fromCharCode.apply(null, data.slice(i * chunk)); | 
 |  |  |     // ↑切片处理数据,防止内存溢出报错↑ | 
 |  |  |  | 
 |  |  |     const unzipStr = Base64.decode(str); | 
 |  |  |     let result = '' | 
 |  |  |  | 
 |  |  |     // 对象或数组进行JSON转换 | 
 |  |  |     try { | 
 |  |  |       result = JSON.parse(unzipStr) | 
 |  |  |     } catch (error) { | 
 |  |  |       if (/Unexpected token o in JSON at position 0/.test(error)) { | 
 |  |  |         // 如果没有转换成功,代表值为基本数据,直接赋值 | 
 |  |  |         result = unzipStr | 
 |  |  |       } | 
 |  |  |     } | 
 |  |  |     return result | 
 |  |  |   } | 
 |  |  | </script> | 
 |  |  | </body> | 
 |  |  | </html> | 
 
 |  |  | 
 |  |  |     #formAdvForm { | 
 |  |  |         background-color: #f3f3f3; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     #formAdvForm .layui-form-item { | 
 |  |  |         margin-top: 20px; | 
 |  |  |         margin-bottom: 0; | 
 |  |  | 
 |  |  |             <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 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> | 
 |  |  |  | 
 |  |  |     <div class="form-group-bottom text-right"> | 
 |  |  |         <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 刷新 </button> | 
 |  |  |         <button class="layui-btn" lay-filter="refresh" lay-submit><i class="layui-icon"></i> 刷新  | 
 |  |  |         </button> | 
 |  |  |     </div> | 
 |  |  |  | 
 |  |  | </form> | 
 |  |  | 
 |  |  |         form.render('select'); | 
 |  |  |  | 
 |  |  |         init(); | 
 |  |  |         function init(){ | 
 |  |  |  | 
 |  |  |         function init() { | 
 |  |  |             notice.msg('正在载入数据......', {icon: 4, position: "topRight"}); | 
 |  |  |             $.ajax({ | 
 |  |  |                 url: baseUrl + "/priOnline2/" + priOnlineId + "/auth", | 
 |  |  | 
 |  |  |                 type: 'datetime' | 
 |  |  |             }); | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         layDateRender(); | 
 |  |  |  | 
 |  |  |         /* 监听表单提交 */ | 
 
 |  |  | 
 |  |  |                         <div class="layui-input-block"> | 
 |  |  |                             <select name="process_memo"> | 
 |  |  |                                 <option value="">请选择状态</option> | 
 |  |  |                                 <option value="1">核价流程</option> | 
 |  |  |                                 <option value="1">规划流程</option> | 
 |  |  |                                 <option value="2">报价流程</option> | 
 |  |  |                                 <option value="3">报销流程</option> | 
 |  |  | <!--                                <option value="4">出差流程</option>--> | 
 |  |  |                                 <option value="5">核价流程</option> | 
 |  |  |                                 <option value="4">集成核价流程</option> | 
 |  |  |                                 <option value="5">货架核价流程</option> | 
 |  |  |                                 <option value="7">合同管理</option> | 
 |  |  |                                 <option value="101">其它规划员</option> | 
 |  |  |                             </select> |