New file |
| | |
| | | package com.dsh.course.feignClient.auth; |
| | | |
| | | import com.dsh.course.feignClient.auth.model.GetTokenRequest; |
| | | import com.dsh.course.feignClient.auth.model.RefreshTokenRequest; |
| | | import com.dsh.course.feignClient.auth.model.TokenResponse; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | @FeignClient("mb-cloud-auth") |
| | | public interface UserClient { |
| | | |
| | | /** |
| | | * 获取登录token |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/oauth/getToken") |
| | | TokenResponse getToken(GetTokenRequest request); |
| | | |
| | | |
| | | /** |
| | | * 刷新登录token |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @PostMapping("/oauth/refreshToken") |
| | | TokenResponse refreshToken(RefreshTokenRequest request); |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.auth.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GetTokenRequest { |
| | | /** |
| | | * 用户名 |
| | | */ |
| | | private String username; |
| | | /** |
| | | * 密码 |
| | | */ |
| | | private String password; |
| | | /** |
| | | * 存储对象 |
| | | */ |
| | | private Object object; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.auth.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class RefreshTokenRequest { |
| | | /** |
| | | * 原始token |
| | | */ |
| | | private String token; |
| | | /** |
| | | * 刷新令牌凭证 |
| | | */ |
| | | private String refresh_token; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.auth.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class TokenResponse { |
| | | /** |
| | | * token |
| | | */ |
| | | private String token; |
| | | /** |
| | | * 刷新token的凭证 |
| | | */ |
| | | private String refresh_token; |
| | | /** |
| | | * 过期时间 |
| | | */ |
| | | private Long expiration_time; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/29 10:09 |
| | | */ |
| | | @FeignClient("mb-cloud-course") |
| | | public interface CourseClient { |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.CourseClient; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.SinataUtil; |
| | | import com.dsh.guns.modular.system.util.DateUtil; |
| | | import com.dsh.guns.modular.system.util.ExcelExportUtil; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/TCompetition") |
| | | public class TCompetitionController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/TCompetition/"; |
| | | |
| | | @Autowired |
| | | private CourseClient courseClient; |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | return PREFIX + "TCompetition.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | return PREFIX + "tCompetition_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_update/{id}") |
| | | public String tCarUpdate(@PathVariable Integer id, Model model) { |
| | | return PREFIX + "tCompetition_edit.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取车辆管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String id, |
| | | String brandName, |
| | | String modelName, |
| | | String carColor, |
| | | String serverStr, |
| | | String carLicensePlate, |
| | | String driverName, |
| | | String companyName, |
| | | String franchiseeName) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(createTime)){ |
| | | String[] timeArray = createTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增车辆管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add( ) { |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tCarId) { |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改车辆管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update() { |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 车辆管理详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tCarId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tCarId") Integer tCarId) { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 下载模板 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | @RequestMapping(value = "/uploadCarModel") |
| | | public void uploadCarModel(HttpServletRequest request, HttpServletResponse response) { |
| | | // 表格数据【封装】 Table datas |
| | | List<List<String>> dataList = new ArrayList<List<String>>(); |
| | | Integer language = UserExt.getLanguage(); |
| | | if(language==1){ |
| | | // 首行【封装】 first line |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("所属机构[平台车辆/加盟车辆]"); |
| | | shellList.add("所属分公司[提示:加盟车辆选填]"); |
| | | shellList.add("所属加盟商[提示:加盟车辆选填]"); |
| | | shellList.add("服务模式:摩托车车[是/否]"); |
| | | shellList.add("服务模式:同城快送[是/否]"); |
| | | shellList.add("车辆品牌"); |
| | | shellList.add("车辆类型"); |
| | | shellList.add("车辆颜色[1(黑色)/2(银色)/3(白色)/4(红色)/5(黄色)/6(橙色)/7(蓝色)]"); |
| | | shellList.add("车牌号"); |
| | | shellList.add("行驶证编号"); |
| | | shellList.add("年检到期时间[例如 2020-02-02]"); |
| | | shellList.add("商业保险到期时间[例如 2020-02-02]"); |
| | | dataList.add(shellList); |
| | | |
| | | try { |
| | | // 调用工具类进行导出 Invoke the utility class to carry out data export. |
| | | ExcelExportUtil.easySheet("平台导入车辆模板"+DateUtil.format(new Date(), "YYYYMMddHHmmss"), "平台导入车辆模板", dataList, request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }else if(language==2){ |
| | | // 首行【封装】 first line |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("Affiliated Organization [Platform Vehicle/Franchised Vehicle]"); |
| | | shellList.add("Affiliated branch [Tip: Select for franchised vehicle]"); |
| | | shellList.add("Franchisee [Tip: Select Franchised vehicle]"); |
| | | shellList.add("Service mode: Motorcycle [Yes/No]"); |
| | | shellList.add("Service mode: intra-city express [Yes/No]"); |
| | | shellList.add("Vehicle brand"); |
| | | shellList.add("Vehicle type"); |
| | | shellList.add("Vehicle color [1(Black)/2(Silver)/3(white)/4(red)/5(yellow)/6(orange)/7(Blue)]"); |
| | | shellList.add("License plate number"); |
| | | shellList.add("License number"); |
| | | shellList.add("Annual inspection expiration time [e.g. 2020-02-02]"); |
| | | shellList.add("Commercial Insurance Expiration Time [e.g. 2020-02-02]"); |
| | | dataList.add(shellList); |
| | | |
| | | try { |
| | | // 调用工具类进行导出 Invoke the utility class to carry out data export. |
| | | ExcelExportUtil.easySheet("Platform import vehicle template"+DateUtil.format(new Date(), "YYYYMMddHHmmss"), "Platform import vehicle template", dataList, request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }else { |
| | | // 首行【封装】 first line |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("Organisasi Berkait [Platform Vehicle/Franchised Vehicle]"); |
| | | shellList.add("Branch terkait [Tip: Pilih untuk kendaraan terkait]"); |
| | | shellList.add("Franchisee [Tip: Pilih kendaraan Franchised]"); |
| | | shellList.add("Mod layanan: Motosikal [Ya/Tidak]"); |
| | | shellList.add("Modus layanan: ekspres intra-kota [Ya/Tidak]"); |
| | | shellList.add("Tanda kendaraan"); |
| | | shellList.add("Jenis kendaraan"); |
| | | shellList.add("Warna kendaraan [1(Hitam)/2(Perak)/3(putih)/4(merah)/5(kuning)/6(oranye)/7(Biru)]"); |
| | | shellList.add("Nomor plat lisensi"); |
| | | shellList.add("Nomor lisensi"); |
| | | shellList.add("Waktu penggantian inspeksi tahunan [contohnya 2020-02-02]"); |
| | | shellList.add("Waktu Expiration Insurance Commercial [contohnya 2020-02-02]"); |
| | | dataList.add(shellList); |
| | | |
| | | try { |
| | | // 调用工具类进行导出 Invoke the utility class to carry out data export. |
| | | ExcelExportUtil.easySheet("templat kendaraan import platform"+DateUtil.format(new Date(), "YYYYMMddHHmmss"), "templat kendaraan import platform", dataList, request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 判断日期是否满足yyyy-MM-dd格式 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isValidDate(String str) { |
| | | boolean convertSuccess=true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | format.setLenient(false); |
| | | format.parse(str); |
| | | } catch (Exception e) { |
| | | convertSuccess=false; |
| | | } |
| | | return convertSuccess; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转换日期 |
| | | * @return |
| | | */ |
| | | public static String importByExcelForDate(String value) {//value就是它的天数 |
| | | String currentCellValue = ""; |
| | | if(value != null && !value.equals("")){ |
| | | Calendar calendar = new GregorianCalendar(1900,0,-1); |
| | | Date d = calendar.getTime(); |
| | | Date dd = DateUtils.addDays(d,Integer.valueOf(value)); |
| | | DateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); |
| | | currentCellValue = formater.format(dd); |
| | | } |
| | | return currentCellValue; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.DeptMapper; |
| | | import com.dsh.course.model.node.ZTreeNode; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.dsh.guns.modular.system.model.Dept; |
| | | import com.dsh.guns.modular.system.service.IDeptService; |
| | | |
| | | @Service |
| | | @Transactional |
| | | public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService { |
| | | |
| | | @Resource |
| | | private DeptMapper deptMapper; |
| | | |
| | | @Override |
| | | public void deleteDept(Integer deptId) { |
| | | Dept dept = deptMapper.selectById(deptId); |
| | | |
| | | QueryWrapper<Dept> wrapper = new QueryWrapper<>(); |
| | | wrapper = wrapper.like("pids", "%[" + dept.getId() + "]%"); |
| | | List<Dept> subDepts = deptMapper.selectList(wrapper); |
| | | for (Dept temp : subDepts) { |
| | | temp.deleteById(); |
| | | } |
| | | |
| | | dept.deleteById(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ZTreeNode> tree() { |
| | | return this.baseMapper.tree(); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> list(String condition) { |
| | | return this.baseMapper.list(condition); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import static com.dsh.guns.core.common.constant.factory.MutiStrFactory.MUTI_STR_CODE; |
| | | import static com.dsh.guns.core.common.constant.factory.MutiStrFactory.MUTI_STR_NAME; |
| | | import static com.dsh.guns.core.common.constant.factory.MutiStrFactory.MUTI_STR_NUM; |
| | | import static com.dsh.guns.core.common.constant.factory.MutiStrFactory.parseKeyValue; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.DictMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.dsh.guns.core.common.exception.BizExceptionEnum; |
| | | import com.dsh.guns.core.exception.GunsException; |
| | | import com.dsh.guns.modular.system.model.Dict; |
| | | import com.dsh.guns.modular.system.service.IDictService; |
| | | |
| | | @Service |
| | | @Transactional |
| | | public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements IDictService { |
| | | |
| | | @Resource |
| | | private DictMapper dictMapper; |
| | | |
| | | @Override |
| | | public void addDict(String dictCode,String dictName,String dictTips, String dictValues) { |
| | | //判断有没有该字典 |
| | | //Check if the dictionary exists |
| | | List<Dict> dicts = dictMapper.selectList(new QueryWrapper<Dict>().eq("code", dictCode).eq("pid", 0)); |
| | | if (dicts != null && dicts.size() > 0) { |
| | | throw new GunsException(BizExceptionEnum.DICT_EXISTED); |
| | | } |
| | | |
| | | //解析dictValues |
| | | List<Map<String, String>> items = parseKeyValue(dictValues); |
| | | |
| | | //添加字典 add dict |
| | | Dict dict = new Dict(); |
| | | dict.setName(dictName); |
| | | dict.setCode(dictCode); |
| | | dict.setTips(dictTips); |
| | | dict.setNum(0); |
| | | dict.setPid(0); |
| | | this.dictMapper.insert(dict); |
| | | |
| | | //添加字典条目 Add dictionary entry |
| | | for (Map<String, String> item : items) { |
| | | String code = item.get(MUTI_STR_CODE); |
| | | String name = item.get(MUTI_STR_NAME); |
| | | String num = item.get(MUTI_STR_NUM); |
| | | Dict itemDict = new Dict(); |
| | | itemDict.setPid(dict.getId()); |
| | | itemDict.setCode(code); |
| | | itemDict.setName(name); |
| | | |
| | | try { |
| | | itemDict.setNum(Integer.valueOf(num)); |
| | | } catch (NumberFormatException e) { |
| | | throw new GunsException(BizExceptionEnum.DICT_MUST_BE_NUMBER); |
| | | } |
| | | this.dictMapper.insert(itemDict); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void editDict(Integer dictId,String dictCode, String dictName,String dictTips, String dicts) { |
| | | //删除之前的字典 add before dict |
| | | this.delteDict(dictId); |
| | | |
| | | //重新添加新的字典 Add a new dictionary again |
| | | this.addDict(dictCode,dictName,dictTips, dicts); |
| | | } |
| | | |
| | | @Override |
| | | public void delteDict(Integer dictId) { |
| | | //删除这个字典的子词典 Delete the sub-dictionary of this dictionary. |
| | | QueryWrapper<Dict> dictEntityWrapper = new QueryWrapper<>(); |
| | | dictEntityWrapper = dictEntityWrapper.eq("pid", dictId); |
| | | dictMapper.delete(dictEntityWrapper); |
| | | |
| | | //删除这个词典 Delete the dictionary |
| | | dictMapper.deleteById(dictId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Dict> selectByCode(String code) { |
| | | return this.baseMapper.selectByCode(code); |
| | | } |
| | | |
| | | @Override |
| | | public List<Dict> selectByParentCode(String code) { |
| | | return this.baseMapper.selectByParentCode(code); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> list(String conditiion) { |
| | | return this.baseMapper.list(conditiion); |
| | | } |
| | | } |
New file |
| | |
| | | //package com.dsh.guns.modular.system.service.impl; |
| | | // |
| | | //import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | //import com.dsh.guns.modular.system.dao.DriverOnlineMapper; |
| | | //import com.dsh.guns.modular.system.model.DriverOnline; |
| | | //import com.dsh.guns.modular.system.service.IDriverOnlineService; |
| | | //import org.springframework.stereotype.Service; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | //import java.util.HashMap; |
| | | //import java.util.List; |
| | | //import java.util.Map; |
| | | // |
| | | // |
| | | //@Service |
| | | //public class DriverOnlineServiceImpl extends ServiceImpl<DriverOnlineMapper, DriverOnline> implements IDriverOnlineService { |
| | | // |
| | | // @Resource |
| | | // private DriverOnlineMapper driverOnlineMapper; |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // /** |
| | | // * 获取列表数据 |
| | | // * @param name |
| | | // * @param phone |
| | | // * @param offset |
| | | // * @param limit |
| | | // * @return |
| | | // * @throws Exception |
| | | // */ |
| | | // @Override |
| | | // public Map<String, Object> queryOnlineDriver(String name, String phone, Integer offset, Integer limit) throws Exception { |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // List<Map<String, Object>> list = driverOnlineMapper.queryOnlineDriver(name, phone, offset, limit); |
| | | // int i = driverOnlineMapper.queryOnlineDriverCount(name, phone); |
| | | // map.put("rows", list); |
| | | // map.put("total", i); |
| | | // return map; |
| | | // } |
| | | // |
| | | // @Override |
| | | // public int queryOnlineDriverCount(String name, String phone) { |
| | | // return driverOnlineMapper.queryOnlineDriverCount(name, phone); |
| | | // } |
| | | //} |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.LoginLogMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.LoginLog; |
| | | import com.dsh.guns.modular.system.service.ILoginLogService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 登录记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng123 |
| | | * @since 2018-02-22 |
| | | */ |
| | | @Service |
| | | public class LoginLogServiceImpl extends ServiceImpl<LoginLogMapper, LoginLog> implements ILoginLogService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getLoginLogs(Page<LoginLog> page, String beginTime, String endTime, String logName, String orderByField, boolean asc) { |
| | | return this.baseMapper.getLoginLogs(page, beginTime, endTime, logName, orderByField, asc); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.MenuMapper; |
| | | import com.dsh.course.model.node.MenuNode; |
| | | import com.dsh.course.model.node.ZTreeNode; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.Menu; |
| | | import com.dsh.guns.modular.system.service.IMenuService; |
| | | |
| | | /** |
| | | * 菜单服务 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-05 22:20 |
| | | */ |
| | | @Service |
| | | public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements IMenuService { |
| | | |
| | | @Resource |
| | | private MenuMapper menuMapper; |
| | | |
| | | @Override |
| | | public void delMenu(Long menuId) { |
| | | |
| | | //删除菜单 delete menu |
| | | this.menuMapper.deleteById(menuId); |
| | | |
| | | //删除关联的delete relation |
| | | this.menuMapper.deleteRelationByMenu(menuId); |
| | | } |
| | | |
| | | @Override |
| | | public void delMenuContainSubMenus(Long menuId) { |
| | | |
| | | Menu menu = menuMapper.selectById(menuId); |
| | | |
| | | //删除当前菜单 dele current menu |
| | | delMenu(menuId); |
| | | |
| | | //删除所有子菜单 delete all sub menu |
| | | QueryWrapper<Menu> wrapper = new QueryWrapper<>(); |
| | | wrapper = wrapper.like("pcodes", "%[" + menu.getCode() + "]%"); |
| | | List<Menu> menus = menuMapper.selectList(wrapper); |
| | | for (Menu temp : menus) { |
| | | delMenu(temp.getId()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectMenus(String condition, String level) { |
| | | return this.baseMapper.selectMenus(condition, level); |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getMenuIdsByRoleId(Integer roleId) { |
| | | return this.baseMapper.getMenuIdsByRoleId(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public List<ZTreeNode> menuTreeList() { |
| | | return this.baseMapper.menuTreeList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ZTreeNode> menuTreeListByMenuIds(List<Long> menuIds) { |
| | | return this.baseMapper.menuTreeListByMenuIds(menuIds); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteRelationByMenu(Long menuId) { |
| | | return this.baseMapper.deleteRelationByMenu(menuId); |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getResUrlsByRoleId(Integer roleId) { |
| | | return this.baseMapper.getResUrlsByRoleId(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public List<MenuNode> getMenusByRoleIds(List<String> roleIds) { |
| | | return this.baseMapper.getMenusByRoleIds(roleIds); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.NoticeMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.Notice; |
| | | import com.dsh.guns.modular.system.service.INoticeService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng123 |
| | | * @since 2018-02-22 |
| | | */ |
| | | @Service |
| | | public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements INoticeService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> list(String condition) { |
| | | return this.baseMapper.list(condition); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.OperationLogMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.OperationLog; |
| | | import com.dsh.guns.modular.system.service.IOperationLogService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 操作日志 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng123 |
| | | * @since 2018-02-22 |
| | | */ |
| | | @Service |
| | | public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, OperationLog> implements IOperationLogService { |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getOperationLogs(Page<OperationLog> page, String beginTime, String endTime, String logName, String s) { |
| | | return this.baseMapper.getOperationLogs(page, beginTime, endTime, logName, s); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.RelationMapper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.Relation; |
| | | import com.dsh.guns.modular.system.service.IRelationService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 角色和菜单关联表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng123 |
| | | * @since 2018-02-22 |
| | | */ |
| | | @Service |
| | | public class RelationServiceImpl extends ServiceImpl<RelationMapper, Relation> implements IRelationService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.RelationMapper; |
| | | import com.dsh.course.mapper.RoleMapper; |
| | | import com.dsh.course.model.node.ZTreeNode; |
| | | import com.dsh.guns.modular.system.controller.util.Convert; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import com.dsh.guns.modular.system.model.Relation; |
| | | import com.dsh.guns.modular.system.model.Role; |
| | | import com.dsh.guns.modular.system.service.IRoleService; |
| | | |
| | | @Service |
| | | public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService { |
| | | |
| | | @Resource |
| | | private RoleMapper roleMapper; |
| | | |
| | | @Resource |
| | | private RelationMapper relationMapper; |
| | | |
| | | @Override |
| | | @Transactional(readOnly = false) |
| | | public void setAuthority(Integer roleId, String ids) { |
| | | |
| | | // 删除该角色所有的权限 Delete all permissions for this role. |
| | | this.roleMapper.deleteRolesById(roleId); |
| | | |
| | | // 添加新的权限 add new permissions |
| | | for (Long id : Convert.toLongArray(true, Convert.toStrArray(",", ids))) { |
| | | Relation relation = new Relation(); |
| | | relation.setRoleid(roleId); |
| | | relation.setMenuid(id); |
| | | this.relationMapper.insert(relation); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(readOnly = false) |
| | | public void delRoleById(Integer roleId) { |
| | | //删除角色 delete role |
| | | this.roleMapper.deleteById(roleId); |
| | | |
| | | // 删除该角色所有的权限 Delete all permissions for this role. |
| | | this.roleMapper.deleteRolesById(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectRoles(String condition) { |
| | | return this.baseMapper.selectRoles(condition); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteRolesById(Integer roleId) { |
| | | return this.baseMapper.deleteRolesById(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public List<ZTreeNode> roleTreeList() { |
| | | return this.baseMapper.roleTreeList(); |
| | | } |
| | | |
| | | @Override |
| | | public List<ZTreeNode> roleTreeListByRoleId(String[] roleId) { |
| | | return this.baseMapper.roleTreeListByRoleId(roleId); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import java.util.List; |
| | | |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.core.dataScope.DataScope; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.dsh.guns.modular.system.model.User; |
| | | import com.dsh.guns.modular.system.service.IUserService; |
| | | |
| | | /** |
| | | * <p> |
| | | * 管理员表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng123 |
| | | * @since 2018-02-22 |
| | | */ |
| | | @Service |
| | | public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService { |
| | | |
| | | @Override |
| | | public int setStatus(Integer userId, int status) { |
| | | return this.baseMapper.setStatus(userId, status); |
| | | } |
| | | |
| | | @Override |
| | | public int changePwd(Integer userId, String pwd) { |
| | | return this.baseMapper.changePwd(userId, pwd); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int setRoles(Integer userId, String roleIds) { |
| | | return this.baseMapper.setRoles(userId, roleIds); |
| | | } |
| | | |
| | | @Override |
| | | public User getByAccount(String account) { |
| | | return this.baseMapper.getByAccount(account); |
| | | } |
| | | |
| | | @Override |
| | | public Integer getMenuNumByRole(String roleStr) { |
| | | return this.baseMapper.getMenuNumByRole(roleStr); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserListPage(Page<Map<String, Object>> page, DataScope dataScope, String name, String beginTime, String endTime, Integer deptid) { |
| | | List<Map<String, Object>> userListPage = this.baseMapper.getUserListPage(page, dataScope, name, beginTime, endTime, deptid); |
| | | return userListPage; |
| | | } |
| | | } |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <div class="ibox-title"> |
| | | <h5>车辆管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="createTime" name="添加时间" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="id" name="车辆ID" /> |
| | | |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="brandName" name="车辆品牌" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="modelName" name="车辆类型" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="carColor" name="车辆颜色" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="serverStr" name="服务模式" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="carLicensePlate" name="车牌号" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="driverName" name="关联司机" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCar.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCar.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <input type="file" name="file" style="width:0px;height:0px;" id="uploadEventFile" onchange="TCar.exportCar()"> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCarTableToolbar" role="group"> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCar.openAddTCar()"/> |
| | | <#button name="修改" icon="fa-edit" clickFun="TCar.openTCarDetail()" space="true"/> |
| | | <#button name="删除" icon="fa-remove" clickFun="TCar.delete()" space="true"/> |
| | | <#button btnCss="info" name="下载模板" id="uploadModel" icon="fa fa-level-down" clickFun="TCar.uploadCarModel()" space="true"/> |
| | | <#button btnCss="danger" name="导入" id="uploadEventBtn" icon="fa fa-level-up" space="true"/> |
| | | <#button name="导出" icon="fa-remove" clickFun="TCar.outCar()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCarTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCar/tCar.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input type="hidden" id="roleType" name="roleType" value="${roleType}"> |
| | | <input hidden id="language" value="${language}"> |
| | | @if(language==1){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">所属机构:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" checked="" onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> 平台车辆 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> 加盟车辆 </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px;display: none;"> |
| | | <option value="">选择所属分公司</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;display: none;"> |
| | | <option value="">选择所属加盟商</option> |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">选择所属加盟商</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">服务模式:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> 摩托车 </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4"> |
| | | <label for="serverBox4"> 同城快送 </label> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" style="display: none;" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">摩托车车型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="display: none;" id="kcModelDiv"> |
| | | <label class="col-sm-3 control-label">同城快送车型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="kcModel" name="kcModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in kcModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <#select id="carBrandId" name="车辆品牌:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">选择车辆品牌</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="车辆类型:"> |
| | | <option value="">选择车辆类型</option> |
| | | </#select> |
| | | <#select id="carColor" name="车辆颜色:"> |
| | | <option value="">选择车辆颜色</option> |
| | | <option value="1">黑色</option> |
| | | <option value="2">银色</option> |
| | | <option value="3">白色</option> |
| | | <option value="4">红色</option> |
| | | <option value="5">黄色</option> |
| | | <option value="6">橙色</option> |
| | | <option value="7">蓝色</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="车牌号" /> |
| | | <#avatar id="carPhoto" name="车辆照片:" /> |
| | | <#input id="drivingLicenseNumber" name="行驶证编号" /> |
| | | <#avatar id="drivingLicensePhoto" name="行驶证照片:" /> |
| | | <#input id="annualInspectionTime" name="年检到期时间" type="text"/> |
| | | <#input id="commercialInsuranceTime" name="商业保险到期时间" type="text"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(language==2){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">Affiliated organization:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" checked="" onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> Platform vehicle </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> Franchised vehicles </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px;display: none;"> |
| | | <option value="">Select Branch</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;display: none;"> |
| | | <option value="">Select the franchisee</option> |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Select the franchisee</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">Service mode:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> motorcycle </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4"> |
| | | <label for="serverBox4"> Intra-city express delivery </label> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" style="display: none;" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">Motorcycle model:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="display: none;" id="kcModelDiv"> |
| | | <label class="col-sm-3 control-label">Local express delivery model:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="kcModel" name="kcModel"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in kcModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <#select id="carBrandId" name="Vehicle brand:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">Select vehicle brand</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="Vehicle type:"> |
| | | <option value="">Vehicle type</option> |
| | | </#select> |
| | | <#select id="carColor" name="Vehicle color:"> |
| | | <option value="">Select vehicle color</option> |
| | | <option value="1">black</option> |
| | | <option value="2">silvery</option> |
| | | <option value="3">white</option> |
| | | <option value="4">red</option> |
| | | <option value="5">yellow</option> |
| | | <option value="6">orange</option> |
| | | <option value="7">blue</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="License plate number" /> |
| | | <#avatar id="carPhoto" name="Vehicle photos:" /> |
| | | <#input id="drivingLicenseNumber" name="Driving license number" /> |
| | | <#avatar id="drivingLicensePhoto" name="Photo of driving license:" /> |
| | | <#input id="annualInspectionTime" name="Annual inspection expiration time" type="text"/> |
| | | <#input id="commercialInsuranceTime" name="Expiration time of commercial insurance" type="text"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="Submit" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="Cancel" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(language==3){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">Organisasi Afiliasi:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" checked="" onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> Kendaraan platform </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> Kendaraan waralaba </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px;display: none;"> |
| | | <option value="">Pilih Branch</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;display: none;"> |
| | | <option value="">Pilih pemilik franchise</option> |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Pilih pemilik franchise</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">Mode Layanan:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> sepeda motor </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4"> |
| | | <label for="serverBox4"> Pengiriman Ekspres Dalam Kota </label> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" style="display: none;" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">Pengaturan model sepeda motor:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="display: none;" id="kcModelDiv"> |
| | | <label class="col-sm-3 control-label">Model pengiriman ekspres lokal:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="kcModel" name="kcModel"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in kcModelList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <#select id="carBrandId" name="Merek kendaraan:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">Pilih Merek Kendaraan</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="Jenis Kendaraan:"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | </#select> |
| | | <#select id="carColor" name="Warna kendaraan:"> |
| | | <option value="">Pilih Warna Kendaraan</option> |
| | | <option value="1">hitam</option> |
| | | <option value="2">perak</option> |
| | | <option value="3">putih</option> |
| | | <option value="4">merah</option> |
| | | <option value="5">kuning</option> |
| | | <option value="6">oranye</option> |
| | | <option value="7">biru</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="车牌号" /> |
| | | <#avatar id="carPhoto" name="Nomor SIM Mengemudi:" /> |
| | | <#input id="drivingLicenseNumber" name="Nomor SIM Mengemudi" /> |
| | | <#avatar id="drivingLicensePhoto" name="Foto SIM:" /> |
| | | <#input id="annualInspectionTime" name="Waktu Kedaluwarsa Inspeksi Tahunan" type="text"/> |
| | | <#input id="commercialInsuranceTime" name="Waktu kedaluwarsa asuransi komersial" type="text"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="Kirim" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="Batal" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCar/tCar_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input type="hidden" id="id" name="id" value="${item.id}"> |
| | | <input hidden id="language" value="${language}"> |
| | | <input type="hidden" id="roleType" name="roleType" value="${roleType}"> |
| | | @if(language==1){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">所属机构:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> 平台车辆 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> 加盟车辆 </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> |
| | | <option value="">选择所属分公司</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">选择所属加盟商</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">选择所属加盟商</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">服务模式:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> 摩托车 </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> |
| | | <label for="serverBox4"> 同城快送 </label> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">摩托车车型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#select id="carBrandId" name="车辆品牌:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">选择车辆品牌</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="车辆类型:"> |
| | | <option value="">选择车辆类型</option> |
| | | @for(obj in modelList){ |
| | | <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carColor" name="车辆颜色:"> |
| | | <option value="">选择车辆颜色</option> |
| | | <option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>黑色</option> |
| | | <option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>银色</option> |
| | | <option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>白色</option> |
| | | <option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>红色</option> |
| | | <option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>黄色</option> |
| | | <option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>橙色</option> |
| | | <option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>蓝色</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="车牌号" value="${item.carLicensePlate}"/> |
| | | <#avatar id="carPhoto" name="车辆照片:" avatarImg="${item.carPhoto}"/> |
| | | <#input id="drivingLicenseNumber" name="行驶证编号" value="${item.drivingLicenseNumber}"/> |
| | | <#avatar id="drivingLicensePhoto" name="行驶证照片:" avatarImg="${item.drivingLicensePhoto}"/> |
| | | <#input id="annualInspectionTime" name="年检到期时间" type="text" value="${item.annualInspectionTime}"/> |
| | | <#input id="commercialInsuranceTime" name="商业保险到期时间" type="text" value="${item.commercialInsuranceTime}"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(language==2){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">Affiliated organization:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> Platform vehicle </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> Franchised vehicles </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> |
| | | <option value="">Select Branch</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Select the franchisee</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Select the franchisee</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">Service mode:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> motorcycle </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> |
| | | <label for="serverBox4"> Intra-city express delivery </label> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">Motorcycle model setting:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="kcModelDiv"> |
| | | <label class="col-sm-3 control-label">Cross city travel model:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="kcModel" name="kcModel"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in kcModelList){ |
| | | <option value="${obj.id}" ${obj.id == kcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#select id="carBrandId" name="Vehicle brand:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">Select vehicle brand</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="Vehicle type:"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in modelList){ |
| | | <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carColor" name="Vehicle color:"> |
| | | <option value="">Select vehicle color</option> |
| | | <option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>black</option> |
| | | <option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>silvery</option> |
| | | <option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>white</option> |
| | | <option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>red</option> |
| | | <option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>yellow</option> |
| | | <option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>orange</option> |
| | | <option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>blue</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="License plate number" value="${item.carLicensePlate}"/> |
| | | <#avatar id="carPhoto" name="Vehicle photos:" avatarImg="${item.carPhoto}"/> |
| | | <#input id="drivingLicenseNumber" name="Driving license number" value="${item.drivingLicenseNumber}"/> |
| | | <#avatar id="drivingLicensePhoto" name="Photo of driving license:" avatarImg="${item.drivingLicensePhoto}"/> |
| | | <#input id="annualInspectionTime" name="Annual inspection expiration time" type="text" value="${item.annualInspectionTime}"/> |
| | | <#input id="commercialInsuranceTime" name="Expiration time of commercial insurance" type="text" value="${item.commercialInsuranceTime}"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="Submit" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="Cancel" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(language==3){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">Organisasi Afiliasi:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> Kendaraan platform </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> Kendaraan waralaba </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> |
| | | <option value="">Pilih Branch</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Pilih pemilik franchise</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Pilih pemilik franchise</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">Mode Layanan:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> sepeda motor </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> |
| | | <label for="serverBox4"> Pengiriman Ekspres Dalam Kota </label> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">Pengaturan model sepeda motor:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="kcModelDiv"> |
| | | <label class="col-sm-3 control-label">Model perjalanan melintasi kota:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="kcModel" name="kcModel"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in kcModelList){ |
| | | <option value="${obj.id}" ${obj.id == kcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#select id="carBrandId" name="Merek kendaraan:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">Pilih Merek Kendaraan</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="Jenis Kendaraan:"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in modelList){ |
| | | <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carColor" name="车辆颜色:"> |
| | | <option value="">选择车辆颜色</option> |
| | | <option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>hitam</option> |
| | | <option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>perak</option> |
| | | <option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>putih</option> |
| | | <option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>merah</option> |
| | | <option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>kuning</option> |
| | | <option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>oranye</option> |
| | | <option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>biru</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="Nomor plat nomor" value="${item.carLicensePlate}"/> |
| | | <#avatar id="carPhoto" name="Foto kendaraan:" avatarImg="${item.carPhoto}"/> |
| | | <#input id="drivingLicenseNumber" name="Nomor SIM Mengemudi" value="${item.drivingLicenseNumber}"/> |
| | | <#avatar id="drivingLicensePhoto" name="Foto SIM:" avatarImg="${item.drivingLicensePhoto}"/> |
| | | <#input id="annualInspectionTime" name="Waktu Kedaluwarsa Inspeksi Tahunan" type="text" value="${item.annualInspectionTime}"/> |
| | | <#input id="commercialInsuranceTime" name="Waktu kedaluwarsa asuransi komersial" type="text" value="${item.commercialInsuranceTime}"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="Kirim" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="Batal" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCar/tCar_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | $(function() { |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == companyType){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == companyType){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | |
| | | TCarInfoDlg.zcServerClick(); |
| | | TCarInfoDlg.kcServerClick(); |
| | | |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var CarInsurance = { |
| | | id: "TCarTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1, |
| | | carId: $('#carId').val() |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | CarInsurance.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '保险公司名称', field: 'insurCom', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '保险号', field: 'insurNum', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '保险类型', field: 'insurType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '保险金额', field: 'insurCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '保险生效时间', field: 'insurEff', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '保险到期时间', field: 'insurExp', visible: true, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | CarInsurance.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | if(language==1){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select a record in the table first!"); |
| | | }else { |
| | | Feng.info("Pilih catatan di tabel terlebih dahulu!"); |
| | | } |
| | | return false; |
| | | }else{ |
| | | CarInsurance.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | CarInsurance.openAddCarInsurance = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'添加':(language==2?'Add':'Tambahkan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCar/showAddCarInsurance?carId=' + CarInsurance.carId |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | CarInsurance.openCarInsuranceDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'编辑':(language==2?'Edit':'Edit'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCar/showEditCarInsurance?id=' + CarInsurance.seItem.id + "&carId=" + CarInsurance.carId |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | var language=1; |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | CarInsurance.delete = function () { |
| | | if (this.check()) { |
| | | swal({ |
| | | title: "您是否确认删除?", |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/delCarInsurance", function (data) { |
| | | swal("删除成功", "您已经成功删除了。", "success"); |
| | | CarInsurance.table.refresh(); |
| | | }, function (data) { |
| | | swal("删除失败", data.responseJSON.message+"!", "warning"); |
| | | }); |
| | | ajax.set("id", CarInsurance.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | CarInsurance.search = function () { |
| | | var queryData = {}; |
| | | CarInsurance.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = CarInsurance.initColumn(); |
| | | var table = new BSTable(CarInsurance.id, "/tCar/queryInsuranceList", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | table.setQueryParams({ |
| | | carId: CarInsurance.carId |
| | | }) |
| | | CarInsurance.table = table.init(); |
| | | }); |
| | | |
New file |
| | |
| | | var CarInsuranceInfo = { |
| | | id: $('#id').val(), |
| | | carId: $('#carId').val() |
| | | } |
| | | |
| | | var language=1; |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | CarInsuranceInfo.close = function() { |
| | | parent.layer.close(window.parent.CarInsurance.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | CarInsuranceInfo.addSubmit = function() { |
| | | var insurCom = $('#insurCom').val(); |
| | | var insurNum = $('#insurNum').val(); |
| | | var insurType = $('#insurType').val(); |
| | | var insurCount = $('#insurCount').val(); |
| | | var insurEff = $('#insurEff').val(); |
| | | var insurExp = $('#insurExp').val(); |
| | | if(null == insurCom || '' == insurCom){ |
| | | Feng.error("保险公司名称不能为空"); |
| | | return; |
| | | } |
| | | if(null == insurNum || '' == insurNum){ |
| | | Feng.error("保险号不能为空"); |
| | | return; |
| | | } |
| | | if(null == insurType || '' == insurType){ |
| | | Feng.error("保险类型不能为空"); |
| | | return; |
| | | } |
| | | if(null == insurCount || '' == insurCount){ |
| | | Feng.error("保险金额不能为空"); |
| | | return; |
| | | } |
| | | if(null == insurEff || '' == insurEff){ |
| | | Feng.error("保险生效时间不能为空"); |
| | | return; |
| | | } |
| | | if(null == insurExp || '' == insurExp){ |
| | | Feng.error("保险到期时间不能为空"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/saveCarInsurance", function(data){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.CarInsurance.table.refresh(); |
| | | CarInsuranceInfo.close(); |
| | | },function(data){ |
| | | if(language==1){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }else if(language==2){ |
| | | Feng.error("Fail to add!" + data.responseJSON.message + "!"); |
| | | }else { |
| | | Feng.error("Gagal menambah!" + data.responseJSON.message + "!"); |
| | | } |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.setData({ |
| | | id: CarInsuranceInfo.id, |
| | | carId: CarInsuranceInfo.carId, |
| | | insurCom: insurCom, |
| | | insurNum: insurNum, |
| | | insurType: insurType, |
| | | insurCount: insurCount, |
| | | insurEff: insurEff, |
| | | insurExp: insurExp |
| | | }) |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | CarInsuranceInfo.queryInfo = function() { |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/queryCarInsurance", function(data){ |
| | | var s = data.data; |
| | | $('#insurCom').val(s.insurCom); |
| | | $('#insurNum').val(s.insurNum); |
| | | $('#insurType').val(s.insurType); |
| | | $('#insurCount').val(s.insurCount); |
| | | $('#insurEff').val(s.insurEff.split(" ")[0]); |
| | | $('#insurExp').val(s.insurExp.split(" ")[0]); |
| | | },function(data){ |
| | | if(language==1){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }else if(language==2){ |
| | | Feng.error("Fail to modify!" + data.responseJSON.message + "!"); |
| | | }else { |
| | | Feng.error("Gagal mengubah!" + data.responseJSON.message + "!");; |
| | | } |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.setData({ |
| | | id: CarInsuranceInfo.id |
| | | }) |
| | | ajax.start(); |
| | | |
| | | } |
| | | |
| | | $(function() { |
| | | if(CarInsuranceInfo.id != ''){ |
| | | CarInsuranceInfo.queryInfo() |
| | | } |
| | | }); |
| | | |
| | | |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCar = { |
| | | id: "TCarTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCar.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '所在省', field: 'insertTime', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '所在市', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '举办门店', field: 'companyName', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '赛事名称', field: 'brandName', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '开始时间', field: 'modelName', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '结束时间', field: 'carColor', visible: true, align: 'center', valign: 'middle',width:'5%', |
| | | }, |
| | | {title: '最大人数-已报名人数', field: 'serverStr', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '报名条件', field: 'carLicensePlate', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D + h + m + s; |
| | | return strDate |
| | | } |
| | | |
| | | function currentTime1(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D ; |
| | | return strDate |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCar.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCar.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCar.openAddTCar = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCar/tCar_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCar.openTCarDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCar/tCar_update/' + TCar.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCar.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCar.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCar.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("tCarId",TCar.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | TCar.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCar/carInsurance?carId=' + TCar.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCar.search = function () { |
| | | var queryData = {}; |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | queryData['id'] = $("#id").val(); |
| | | queryData['brandName'] = $("#brandName").val(); |
| | | queryData['modelName'] = $("#modelName").val(); |
| | | queryData['carColor'] = $("#carColor").val(); |
| | | queryData['serverStr'] = $("#serverStr").val(); |
| | | queryData['carLicensePlate'] = $("#carLicensePlate").val(); |
| | | queryData['driverName'] = $("#driverName").val(); |
| | | queryData['companyName'] = $("#companyName").val(); |
| | | queryData['franchiseeName'] = $("#franchiseeName").val(); |
| | | TCar.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCar.resetSearch = function () { |
| | | $("#createTime").val(""); |
| | | $("#id").val(""); |
| | | $("#brandName").val(""); |
| | | $("#modelName").val(""); |
| | | $("#carColor").val(""); |
| | | $("#serverStr").val(""); |
| | | $("#carLicensePlate").val(""); |
| | | $("#driverName").val(""); |
| | | $("#companyName").val(""); |
| | | $("#franchiseeName").val(""); |
| | | TCar.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCar.initColumn(); |
| | | var table = new BSTable(TCar.id, "/tCar/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCar.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCar.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/tCar/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCar.exportCar = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/tCar/exportCar'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCar.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCar.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCar.outCar = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/tCar/outCar"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=$("#language").val(); |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | carBrandId: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'请选择车辆品牌':(language==2?"Please select the vehicle brand":"Silakan pilih tanda kendaraan") |
| | | } |
| | | } |
| | | }, |
| | | carModelId: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'请选择车辆类型':(language==2?"Please select the vehicle type":"Silakan pilih tipe kendaraan") |
| | | } |
| | | } |
| | | }, |
| | | zcModel: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'请选择摩托车车型':(language==2?"Please select a motorcycle model":"Silakan pilih model motor") |
| | | } |
| | | } |
| | | }, |
| | | carColor: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'车辆颜色不能为空':(language==2?"The vehicle color cannot be empty.":"Warna kendaraan tidak bisa kosong.") |
| | | } |
| | | } |
| | | }, |
| | | drivingLicenseNumber: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'行驶证编号不能为空':(language==2?"The driving license number cannot be empty":"Nomor SIM Tidak Bisa Kosong") |
| | | } |
| | | } |
| | | }, |
| | | annualInspectionTime: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'年检到期时间不能为空':(language==2?"The annual inspection expiration time cannot be empty":"Waktu kedaluwarsa inspeksi tahunan tidak bisa kosong") |
| | | } |
| | | } |
| | | }, |
| | | commercialInsuranceTime: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'商业保险到期时间不能为空':(language==2?"The commercial insurance expiration time cannot be empty":"Waktu kedaluwarsa asuransi komersial tidak bisa kosong") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCar.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | | .set('companyId') |
| | | .set('franchiseeId') |
| | | .set('carColor') |
| | | .set('carModelId') |
| | | .set('carBrandId') |
| | | .set('carLicensePlate') |
| | | .set('carPhoto') |
| | | .set('drivingLicenseNumber') |
| | | .set('drivingLicensePhoto') |
| | | .set('annualInspectionTime') |
| | | .set('commercialInsuranceTime') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('addType') |
| | | .set('addObjectId') |
| | | .set('plateColor') |
| | | .set('vehicleType') |
| | | .set('ownerName') |
| | | .set('engineId') |
| | | .set('VIN') |
| | | .set('certifyDateA') |
| | | .set('fuelType') |
| | | .set('engineDisplace') |
| | | .set('certificate') |
| | | .set('transAgency') |
| | | .set('transArea') |
| | | .set('transDateStart') |
| | | .set('transDateStop') |
| | | .set('certifyDateB') |
| | | .set('fixState') |
| | | .set('nextFixDate') |
| | | .set('checkState') |
| | | .set('feePrintId') |
| | | .set('GPSBrand') |
| | | .set('GPSModel') |
| | | .set('GPSIMEI') |
| | | .set('GPSInstallDate') |
| | | .set('registerDate') |
| | | .set('commercialType'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var roleType = $("#roleType").val(); //1=平台 2=分公司 3=加盟商 |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == roleType){ |
| | | if (2 == companyType){ |
| | | var oneId = $("#oneId").val(); |
| | | if ("" == oneId){ |
| | | if(language==1){ |
| | | Feng.info("所属分公司不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The subordinate branch cannot be empty!"); |
| | | }else { |
| | | Feng.info("Cabang subordinat tidak dapat kosong!"); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var serverBox =[]; |
| | | $('input[name="serverBox"]:checked').each(function(){ |
| | | serverBox.push($(this).val()); |
| | | }); |
| | | if (serverBox.length == 0){ |
| | | if(language==1){ |
| | | Feng.info("请选择经营业务"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select business"); |
| | | }else { |
| | | Feng.info("Pilih bisnis"); |
| | | } |
| | | return; |
| | | } |
| | | var carPhoto = $("#carPhoto").valueOf(); |
| | | if ("" == carPhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传车辆照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of the vehicle"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraan"); |
| | | } |
| | | |
| | | return; |
| | | } |
| | | var drivingLicensePhoto = $("#drivingLicensePhoto").valueOf(); |
| | | if ("" == drivingLicensePhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传行驶证照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of your vehicle. Please upload a photo of your driving license"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraanmu. Silakan mengunggah foto dari lisensi mengemudi Anda"); |
| | | } |
| | | |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/add", function(data){ |
| | | if(data.status == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCar.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | if(language==1){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }else if(language==2){ |
| | | Feng.error("Fail to add!" + data.responseJSON.message + "!"); |
| | | }else { |
| | | Feng.error("Gagal menambah!" + data.responseJSON.message + "!"); |
| | | } |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("serverBox",serverBox.toString()); |
| | | ajax.set("zcModel",$("#zcModel").val()); |
| | | ajax.set("kcModel",$("#kcModel").val()); |
| | | ajax.set("roleType",roleType); |
| | | if (1 == roleType){ |
| | | ajax.set("companyType",companyType); |
| | | ajax.set("oneId",$("#oneId").val()); |
| | | ajax.set("twoId",$("#twoId").val()); |
| | | ajax.set("franchiseeId",0); |
| | | } else if (2 == roleType) { |
| | | ajax.set("franchiseeId",$("#franchiseeId").val()); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | }else if (3 == roleType){ |
| | | ajax.set("franchiseeId",0); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | } |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | var roleType = $("#roleType").val(); //1=平台 2=分公司 3=加盟商 |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == roleType){ |
| | | if (2 == companyType){ |
| | | var oneId = $("#oneId").val(); |
| | | if ("" == oneId){ |
| | | if(language==1){ |
| | | Feng.info("所属分公司不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The subordinate branch cannot be empty!"); |
| | | }else { |
| | | Feng.info("Cabang subordinat tidak dapat kosong!"); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var serverBox =[]; |
| | | $('input[name="serverBox"]:checked').each(function(){ |
| | | serverBox.push($(this).val()); |
| | | }); |
| | | if (serverBox.length == 0){ |
| | | if(language==1){ |
| | | Feng.info("请选择经营业务"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select business"); |
| | | }else { |
| | | Feng.info("Pilih bisnis"); |
| | | } |
| | | return; |
| | | } |
| | | var carPhoto = $("#carPhoto").valueOf(); |
| | | if ("" == carPhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传车辆照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of the vehicle"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraan"); |
| | | } |
| | | return; |
| | | } |
| | | var drivingLicensePhoto = $("#drivingLicensePhoto").valueOf(); |
| | | if ("" == drivingLicensePhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传行驶证照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of your vehicle. Please upload a photo of your driving license"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraanmu. Silakan mengunggah foto dari lisensi mengemudi Anda"); |
| | | } |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/update", function(data){ |
| | | if(data.status == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCar.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | if(language==1){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }else if(language==2){ |
| | | Feng.error("Fail to modify!" + data.responseJSON.message + "!"); |
| | | }else { |
| | | Feng.error("Gagal mengubah!" + data.responseJSON.message + "!");; |
| | | } |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("serverBox",serverBox.toString()); |
| | | ajax.set("zcModel",$("#zcModel").val()); |
| | | ajax.set("kcModel",$("#kcModel").val()); |
| | | ajax.set("roleType",roleType); |
| | | if (1 == roleType){ |
| | | ajax.set("companyType",companyType); |
| | | ajax.set("oneId",$("#oneId").val()); |
| | | ajax.set("twoId",$("#twoId").val()); |
| | | ajax.set("franchiseeId",0); |
| | | } else if (2 == roleType) { |
| | | ajax.set("franchiseeId",$("#franchiseeId").val()); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | }else if (3 == roleType){ |
| | | ajax.set("franchiseeId",0); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | } |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/oneChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择所属加盟商</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Choose your franchisee</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#twoId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |