feat: 实现快递查询功能(修复登录BUG)

master
wjl 4 months ago
parent 83ec3d1871
commit db02cf0534

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="kuaidizhan" />
</profile>
</annotationProcessing>
</component>
</project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK" />
</project>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/src/main/java" vcs="Git" />
</component>
</project>

@ -0,0 +1,296 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jlwl</groupId>
<artifactId>kuaidizhan</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>5.0.0.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<druid.version>1.1.0</druid.version>
<fastjson.version>1.2.8</fastjson.version>
<mybaitsplus.version>2.3</mybaitsplus.version>
<mysql.version>5.1.38</mysql.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.19</slf4j.version>
<aspectjweaver.version>1.8.8</aspectjweaver.version>
<fileupload.version>1.3.1</fileupload.version>
<jstl.version>1.2</jstl.version>
</properties>
<dependencies>
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- Spring MVC -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<!-- AOP -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectjweaver.version}</version>
</dependency>
<!-- FileUpload -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${fileupload.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Mybatis-Plus -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>${mybaitsplus.version}</version>
</dependency>
<!-- Mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- Druid -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- FastJson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- Log -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>2.0.1.Final</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.0.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.29</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-beanutils/commons-beanutils -->
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.servlet.jsp/jsp-api -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<!-- 百度人工智能 -->
<dependency>
<groupId>com.baidu.aip</groupId>
<artifactId>java-sdk</artifactId>
<version>4.4.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-jasper -->
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>9.0.27</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.2.4.Final</version>
</dependency>
<!-- 导入导出excel -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.11-beta2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.11-beta2</version>
</dependency>
</dependencies>
<build>
<!-- 项目访问名称 -->
<finalName>kuaidizhan</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -0,0 +1,60 @@
package com.controller;
import java.io.*;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.*;
import jakarta.servlet.annotation.*;
@WebServlet("/download")
public class AntiLeechServlet extends HttpServlet {
// 允许访问的域名白名单(根据实际修改)
private static final String[] ALLOWED_DOMAINS = {
"http://your-domain.com",
"https://www.your-domain.com"
};
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
// 获取来源域名
String referer = request.getHeader("Referer");
// 防盗链检查
if (referer == null || !isAllowedDomain(referer)) {
response.sendError(HttpServletResponse.SC_FORBIDDEN, "禁止直接访问");
return;
}
// 文件路径配置(根据实际路径修改)
String filePath = getServletContext().getRealPath("/WEB-INF/resources/images/image.png");
File file = new File(filePath);
// 检查文件是否存在
if (!file.exists()) {
response.sendError(HttpServletResponse.SC_NOT_FOUND);
return;
}
// 设置响应头
response.setContentType("image/png");
response.setHeader("Content-Disposition", "attachment; filename=\"image.png\"");
response.setContentLength((int) file.length());
// 文件传输
try (InputStream in = new FileInputStream(file);
OutputStream out = response.getOutputStream()) {
byte[] buffer = new byte[4096];
int bytesRead;
while ((bytesRead = in.read(buffer)) != -1) {
out.write(buffer, 0, bytesRead);
}
}
}
// 域名白名单验证方法
private boolean isAllowedDomain(String referer) {
if (referer == null) return false;
for (String domain : ALLOWED_DOMAINS) {
if (referer.startsWith(domain)) {
return true;
}
}
return false;
}
}

@ -33,163 +33,252 @@ import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;
/**
*
*
*
*
*
* - CommonService
* - ConfigService
*
*
* 1.
* 2.
* 3.
*/
@RestController
public class CommonController {
@Autowired
private CommonService commonService;
private CommonService commonService; // 通用业务逻辑服务
@Autowired
private ConfigService configService;
private static AipFace client = null;
private ConfigService configService; // 配置管理服务
private static String BAIDU_DITU_AK = null;
private static AipFace client = null; // 百度人脸识别客户端(单例模式)
private static String BAIDU_DITU_AK = null; // 百度地图AK从配置中心获取
/**
*
* API
*
* @param lng 116.404
* @param lat 39.915
* @return {"status":0,"result":{"city":"北京市"}}
*
* @throws baidu_ditu_ak
*/
@RequestMapping("/location")
public R location(String lng, String lat) {
// 懒加载配置(首次调用时从数据库加载配置)
if (BAIDU_DITU_AK == null) {
BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();
if(BAIDU_DITU_AK==null) {
ConfigEntity config = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")
);
BAIDU_DITU_AK = config.getValue();
if (StringUtils.isEmpty(BAIDU_DITU_AK)) {
return R.error("请在配置管理中正确配置baidu_ditu_ak");
}
}
// 调用百度地图逆地理编码API
Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);
return R.ok().put("data", map);
}
/**
*
* 1:1
* 使AI
*
* @param face1 1
* @param face2 2
* @return
* @param face1 1upload
* @param face2 2
* @param request HTTP
* @return {"score":85.5}
*
* @throws APIKey/SecretKey
* @throws
*/
@RequestMapping("/matchFace")
public R matchFace(String face1, String face2, HttpServletRequest request) {
// 初始化百度AI客户端单例模式保证线程安全
if (client == null) {
/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/
String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();
String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();
String APIKey = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "APIKey")
).getValue();
String SecretKey = configService.selectOne(
new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")
).getValue();
String token = BaiduUtil.getAuth(APIKey, SecretKey);
if (token == null) {
return R.error("请在配置管理中正确配置APIKey和SecretKey");
}
client = new AipFace(null, APIKey, SecretKey);
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
client.setConnectionTimeoutInMillis(2000); // 连接超时2秒
client.setSocketTimeoutInMillis(60000); // 数据传输超时60秒
}
JSONObject res = null;
try {
File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);
File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);
// 构建服务器文件路径从web应用根目录获取
String uploadPath = request.getSession()
.getServletContext()
.getRealPath("/upload");
File file1 = new File(uploadPath, face1);
File file2 = new File(uploadPath, face2);
// 图片转Base64编码
String img1 = Base64Util.encode(FileUtil.FileToByte(file1));
String img2 = Base64Util.encode(FileUtil.FileToByte(file2));
// 构造比对请求参数
MatchRequest req1 = new MatchRequest(img1, "BASE64");
MatchRequest req2 = new MatchRequest(img2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
ArrayList<MatchRequest> requests = new ArrayList<>();
requests.add(req1);
requests.add(req2);
res = client.match(requests);
System.out.println(res.get("result"));
// 执行人脸比对
JSONObject res = client.match(requests);
return R.ok().put("data",
JSONObject.parse(res.get("result").toString())
);
} catch (FileNotFoundException e) {
e.printStackTrace();
return R.error("文件不存在");
return R.error("文件不存在:" + e.getMessage());
} catch (IOException e) {
e.printStackTrace();
return R.error("文件处理失败:" + e.getMessage());
}
return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));
}
/**
* tablecolumn()
* @param table
* @param column
* @return
*
*
*
* @param tableName sys_area
* @param columnName parent_id ID
* @param level
* @param parent ID
* @return ["选项1","选项2"]
*
* @apiNote /option/sys_area/area_name?level=2&parent=110000
*/
@RequestMapping("/option/{tableName}/{columnName}")
@IgnoreAuth
public R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {
Map<String, Object> params = new HashMap<String, Object>();
@IgnoreAuth // 标注不需要登录验证
public R getOption(@PathVariable String tableName,
@PathVariable String columnName,
@RequestParam(required = false) String level,
@RequestParam(required = false) String parent) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
// 添加可选参数
if (StringUtils.isNotBlank(level)) {
params.put("level", level);
}
if (StringUtils.isNotBlank(parent)) {
params.put("parent", parent);
}
List<String> data = commonService.getOption(params);
return R.ok().put("data", data);
}
}
/**
* tablecolumn
* @param table
* @param column
* @return
*/
/**
*
*
*
* @param tableName sys_user
* @param columnName dept_id ID
* @param columnValue 1001
* @return {"id":1,"name":"测试数据"}
*
* @apiNote /follow/sys_user/dept_id/1001
*/
@RequestMapping("/follow/{tableName}/{columnName}")
@IgnoreAuth
public R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {
Map<String, Object> params = new HashMap<String, Object>();
public R getFollowByOption(@PathVariable String tableName,
@PathVariable String columnName,
@RequestParam String columnValue) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
params.put("columnValue", columnValue);
params.put("columnValue", columnValue); // 关键查询条件
Map<String, Object> result = commonService.getFollowByOption(params);
return R.ok().put("data", result);
}
/**
* tablesfsh
* @param table
* @param map
* @return
*
* sh
*
* @param tableName news
* @param map id-ID, shzt-
* @return
*
* @apiNote
* POST /sh/news
* Body: {"id":123,"shzt":"1"}
*/
@RequestMapping("/sh/{tableName}")
public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {
map.put("table", tableName);
commonService.sh(map);
public R sh(@PathVariable String tableName,
@RequestBody Map<String, Object> map) {
map.put("table", tableName); // 注入表名参数
commonService.sh(map); // 调用通用审核服务
return R.ok();
}
/**
*
* @param tableName
* @param columnName
* @param type 1: 2:
* @param map
* @return
*
*
*
* @param tableName order
* @param columnName create_time
* @param type 1: 2:
* @param map
* - remindstart:
* - remindend:
* @return {"count":5}
*
* @apiNote
* +remindstart +remindend
*/
@RequestMapping("/remind/{tableName}/{columnName}/{type}")
@IgnoreAuth
public R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
public R remindCount(@PathVariable String tableName,
@PathVariable String columnName,
@PathVariable String type,
@RequestParam Map<String, Object> map) {
map.put("table", tableName);
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
// 日期类型特殊处理
if ("2".equals(type)) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
// 处理开始日期偏移(支持负数表示过去天数)
if (map.get("remindstart") != null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
int offset = Integer.parseInt(map.get("remindstart").toString());
c.add(Calendar.DAY_OF_MONTH, offset);
map.put("remindstart", sdf.format(c.getTime()));
}
// 处理结束日期偏移
if (map.get("remindend") != null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
int offset = Integer.parseInt(map.get("remindend").toString());
c.add(Calendar.DAY_OF_MONTH, offset);
map.put("remindend", sdf.format(c.getTime()));
}
}
@ -198,43 +287,64 @@ public class CommonController{
}
/**
*
*
*
*
* @param tableName finance
* @param columnName amount
* @return {"sum":1000.5}
*/
@RequestMapping("/cal/{tableName}/{columnName}")
@IgnoreAuth
public R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
public R cal(@PathVariable String tableName,
@PathVariable String columnName) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
Map<String, Object> result = commonService.selectCal(params);
return R.ok().put("data", result);
}
/**
*
*
* GROUP BY
*
* @param tableName sales
* @param columnName product_type
* @return [{"group":"类型A","count":10},...]
*/
@RequestMapping("/group/{tableName}/{columnName}")
@IgnoreAuth
public R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {
Map<String, Object> params = new HashMap<String, Object>();
public R group(@PathVariable String tableName,
@PathVariable String columnName) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("column", columnName);
List<Map<String, Object>> result = commonService.selectGroup(params);
return R.ok().put("data", result);
}
/**
*
*
* X/Y
*
* @param tableName visit_log 访
* @param xColumnName Xdate
* @param yColumnName Ychannel
* @return [{"x":"2023-01-01","y":"SEO","count":15},...]
*/
@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")
@IgnoreAuth
public R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {
Map<String, Object> params = new HashMap<String, Object>();
public R value(@PathVariable String tableName,
@PathVariable String yColumnName,
@PathVariable String xColumnName) {
Map<String, Object> params = new HashMap<>();
params.put("table", tableName);
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
List<Map<String, Object>> result = commonService.selectValue(params);
return R.ok().put("data", result);
}
}

@ -0,0 +1,13 @@
package com.controller;
import java.lang.annotation.*;
/**
* Token
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface IgnoreAuth {
}

@ -37,127 +37,146 @@ import com.utils.R;
* @email
* @date 2021-03-11
*/
/**
*
* CRUD
*
*
* 1.
* 2.
* 3.
*
* @author
* @email
* @date 2021-03-11
*/
@RestController
@Controller
@RequestMapping("/zhandian")
public class ZhandianController {
private static final Logger logger = LoggerFactory.getLogger(ZhandianController.class);
@Autowired
private ZhandianService zhandianService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
@Autowired private ZhandianService zhandianService; // 站点核心业务服务
@Autowired private TokenService tokenService; // 用户认证服务
@Autowired private DictionaryService dictionaryService; // 数据字典服务
/**
*
*
* @param params page/limit
* @param request HTTP
* @return
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params, HttpServletRequest request) {
logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
String role = String.valueOf(request.getSession().getAttribute("role"));
if(StringUtil.isNotEmpty(role) && "用户".equals(role)){
// 日志记录:输出调试信息(使用参数化日志避免字符串拼接)
logger.debug("分页查询参数: {}", JSONObject.toJSONString(params));
// 用户权限校验:普通用户只能查看关联数据
if("用户".equals(request.getSession().getAttribute("role"))) {
params.put("yonghuId", request.getSession().getAttribute("userId"));
}
// 执行分页查询
PageUtils page = zhandianService.queryPage(params);
//字典表数据转换
List<ZhandianView> list =(List<ZhandianView>)page.getList();
for(ZhandianView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
// 数据转换:将实体列表转为视图对象并处理字典值
((List<ZhandianView>)page.getList()).forEach(dictionaryService::dictionaryConvert);
return R.ok().put("data", page);
}
/**
*
*
* @param id ID
* @return
* @throws 511
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id) {
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
ZhandianEntity zhandian = zhandianService.selectById(id);
if(zhandian !=null){
//entity转view
logger.debug("查询站点详情, ID: {}", id);
ZhandianEntity entity = zhandianService.selectById(id);
if(entity == null) return R.error(511, "查不到数据");
// 实体转视图:过滤敏感字段并准备返回数据
ZhandianView view = new ZhandianView();
BeanUtils.copyProperties( zhandian , view );//把实体数据重构到view中
BeanUtils.copyProperties(entity, view);
//修改对应字典表字段
// 字典值转换:将编码值转为可读文本
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
*
*/
@RequestMapping("/save")
public R save(@RequestBody ZhandianEntity zhandian, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,zhandian:{}",this.getClass().getName(),zhandian.toString());
/**
*
* @param zhandian zdname/address
* @param request HTTP
* @return 200511
*
* @apiNote
* 1. zdname+address
* 2.
*/
@RequestMapping("/add")
public R add(@RequestBody ZhandianEntity zhandian, HttpServletRequest request) {
// 唯一性校验(名称+地址组合唯一)
Wrapper<ZhandianEntity> queryWrapper = new EntityWrapper<ZhandianEntity>()
.eq("zdname", zhandian.getZdname())
.eq("address", zhandian.getAddress())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhandianEntity zhandianEntity = zhandianService.selectOne(queryWrapper);
if(zhandianEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// zhandian.set
// }
.eq("address", zhandian.getAddress());
if(zhandianService.selectOne(queryWrapper) == null) {
// 权限校验预留接口(当前注释状态)
zhandianService.insert(zhandian);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
return R.error(511, "表中有相同数据");
}
/**
*
*
* @param zhandian id
* @param request HTTP
* @return 200511
*
* @apiNote
* 1. idzdname+address
* 2.
* 3.
*/
@RequestMapping("/update")
public R update(@RequestBody ZhandianEntity zhandian, HttpServletRequest request) {
logger.debug("update方法:,,Controller:{},,zhandian:{}",this.getClass().getName(),zhandian.toString());
//根据字段查询是否有相同数据
// 唯一性校验(排除当前记录)
Wrapper<ZhandianEntity> queryWrapper = new EntityWrapper<ZhandianEntity>()
.notIn("id", zhandian.getId())
.eq("zdname", zhandian.getZdname())
.eq("address", zhandian.getAddress())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
ZhandianEntity zhandianEntity = zhandianService.selectOne(queryWrapper);
if(zhandianEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// zhandian.set
// }
zhandianService.updateById(zhandian);//根据id更新
.eq("address", zhandian.getAddress());
logger.info("生成的SQL片段: {}", queryWrapper.getSqlSegment());
if(zhandianService.selectOne(queryWrapper) == null) {
zhandianService.updateById(zhandian);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
return R.error(511, "表中有相同数据");
}
/**
*
*
* @param ids ID
* @return
*
* @apiNote
* 1. 使
* 2.
* 3.
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids) {
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
zhandianService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
logger.debug("待删除ID列表: {}", Arrays.toString(ids));
int affectRows = zhandianService.deleteBatchIds(Arrays.asList(ids));
return R.ok().put("data", "成功删除"+affectRows+"条记录");
}
}

@ -0,0 +1,5 @@
validationQuery=SELECT 1
jdbc_url=jdbc:mysql://127.0.0.1:3306/kuaidizhan?useUnicode=true&characterEncoding=UTF-8&tinyInt1isBit=false
jdbc_username=root
jdbc_password=123456

@ -0,0 +1,41 @@
/*
Navicat Premium Data Transfer
Source Server : mysql-localhost
Source Server Type : MySQL
Source Server Version : 50616
Source Host : localhost
Source Database : mybatis-plus
Target Server Type : MySQL
Target Server Version : 50616
File Encoding : utf-8
Date: 06/25/2017 20:53:49 PM
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `sys_user`
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` bigint(20) NOT NULL COMMENT '用户ID',
`name` varchar(50) DEFAULT NULL COMMENT '用户名',
`age` int(3) DEFAULT NULL COMMENT '用户年龄',
`type` int(1) DEFAULT '0' COMMENT '0、禁用 1、正常, 如果使用tinyint(1)mysql连接没加tinyInt1isBit=false默认mysql驱动会把值转成boolean',
`ctime` datetime DEFAULT NULL COMMENT '自定义填充的创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统用户表';
-- ----------------------------
-- Records of `sys_user`
-- ----------------------------
BEGIN;
INSERT INTO `sys_user`(id,name,age,ctime,type) VALUES ('784972358981328902', 'Tom', '24', '2017-06-25 20:53:33', '1');
INSERT INTO `sys_user`(id,name,age,ctime,type) VALUES ('784972358981328903', 'Jammy', '21', '2017-06-25 20:53:37', '1');
COMMIT;
SET FOREIGN_KEY_CHECKS = 1;

@ -0,0 +1,19 @@
log4j.rootLogger=DEBUG,CONSOLE,A
log4j.addivity.org.apache=false
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=DEBUG
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss} -%-4r [%t] %-5p %x - %m%n
log4j.appender.CONSOLE.Target=System.out
#log4j.appender.CONSOLE.charset=utf-8
log4j.appender.CONSOLE.encoding=utf-8
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.A=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A.File=${catalina.home}/logs/yo_log/PurePro_
log4j.appender.A.DatePattern=yyyy-MM-dd'.log'
log4j.appender.A.layout=org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern=[FH_sys] %d{yyyy-MM-dd HH\:mm\:ss} %5p %c{1}\:%L \: %m%n
log4j.logger.java.sql.ResultSet=INFO
log4j.logger.org.apache=DEBUG
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.CommonDao">
<select id="getOption" resultType="String" >
SELECT distinct ${column} FROM ${table}
where ${column} is not null and ${column} !=''
<if test = "level != null">
and level=#{level}
</if>
<if test = "parent != null">
and parent=#{parent}
</if>
</select>
<select id="getFollowByOption" resultType="map" >
SELECT * FROM ${table} where ${column}=#{columnValue}
</select>
<update id="sh">
UPDATE ${table} set sfsh=#{sfsh} where id=#{id}
</update>
<select id="remindCount" resultType="int" >
SELECT count(1) FROM ${table}
where 1=1
<if test = "type == 1 ">
<if test = " remindstart != null ">
and ${column} &gt;= #{remindstart}
</if>
<if test = " remindend != null ">
and ${column} &lt;= #{remindend}
</if>
</if>
<if test = "type == 2 ">
<if test = " remindstart != null ">
and ${column} &gt;= str_to_date(#{remindstart},'%Y-%m-%d')
</if>
<if test = " remindend != null ">
and ${column} &lt;= str_to_date(#{remindend},'%Y-%m-%d')
</if>
</if>
</select>
<select id="selectCal" resultType="map" >
SELECT sum(${column}) sum,max(${column}) max,min(${column}) min,avg(${column}) avg FROM ${table}
</select>
<select id="selectGroup" resultType="map" >
SELECT ${column} , count(1) total FROM ${table} group by ${column}
</select>
<select id="selectValue" resultType="map" >
SELECT ${xColumn}, sum(${yColumn}) total FROM ${table} group by ${xColumn}
</select>
</mapper>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.ConfigDao">
</mapper>

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.DaiquDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.dqname as dqname
,a.zhandian_id as zhandianId
,a.yonghu_id as yonghuId
,a.kddx_types as kddxTypes
,a.dqphone as dqphone
,a.takecode as takecode
,a.kdzt_types as kdztTypes
,a.pickup_time as pickupTime
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.DaiquView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
,yonghu.studentnumber as studentnumber
,yonghu.name as name
,yonghu.username as username
,yonghu.password as password
,yonghu.sex_types as sexTypes
,yonghu.img_photo as imgPhoto
,yonghu.phone as phone
,yonghu.zhuSuLou as zhuSuLou
,yonghu.dormitory as dormitory
,yonghu.role as role
,zhandian.zdname as zdname
,zhandian.address as address
FROM daiqu a
left JOIN yonghu yonghu ON a.yonghu_id = yonghu.id
left JOIN zhandian zhandian ON a.zhandian_id = zhandian.id
<where>
<if test=" params.dqname != '' and params.dqname != null and params.dqname != 'null' ">
and a.dqname like CONCAT('%',#{params.dqname},'%')
</if>
<if test="params.zhandianId != null">
and a.zhandian_id = #{params.zhandianId}
</if>
<if test="params.yonghuId != null">
and a.yonghu_id = #{params.yonghuId}
</if>
<if test="params.kddxTypes != null">
and a.kddx_types = #{params.kddxTypes}
</if>
<if test="params.dqphoneStart != null">
<![CDATA[ and a.dqphone >= #{params.dqphoneStart} ]]>
</if>
<if test="params.dqphoneEnd != null">
<![CDATA[ and a.dqphone <= #{params.dqphoneEnd} ]]>
</if>
<if test=" params.takecode != '' and params.takecode != null and params.takecode != 'null' ">
and a.takecode like CONCAT('%',#{params.takecode},'%')
</if>
<if test="params.kdztTypes != null">
and a.kdzt_types = #{params.kdztTypes}
</if>
<if test=" params.pickupTimeStart != '' and params.pickupTimeStart != null ">
<![CDATA[ and DATE_FORMAT(a.pickup_time, '%Y-%m-%d %H:%T:%s') >=
DATE_FORMAT(#{params.pickupTimeStart}, '%Y-%m-%d %H:%T:%s') ]]>
</if>
<if test=" params.pickupTimeEnd != '' and params.pickupTimeEnd != null ">
<![CDATA[ and DATE_FORMAT(a.pickup_time, '%Y-%m-%d %H:%T:%s') <=
DATE_FORMAT(#{params.pickupTimeEnd} , '%Y-%m-%d %H:%T:%s') ]]>
</if>
<if test=" params.studentnumber != '' and params.studentnumber != null and params.studentnumber != 'null' ">
and yonghu.studentnumber like CONCAT('%',#{params.studentnumber},'%')
</if>
<if test=" params.name != '' and params.name != null and params.name != 'null' ">
and yonghu.name like CONCAT('%',#{params.name},'%')
</if>
<if test=" params.username != '' and params.username != null and params.username != 'null' ">
and yonghu.username like CONCAT('%',#{params.username},'%')
</if>
<if test=" params.password != '' and params.password != null and params.password != 'null' ">
and yonghu.password like CONCAT('%',#{params.password},'%')
</if>
<if test="params.sexTypes != null">
and yonghu.sex_types = #{params.sexTypes}
</if>
<if test=" params.phone != '' and params.phone != null and params.phone != 'null' ">
and yonghu.phone like CONCAT('%',#{params.phone},'%')
</if>
<if test=" params.zhuSuLou != '' and params.zhuSuLou != null and params.zhuSuLou != 'null' ">
and yonghu.zhuSuLou like CONCAT('%',#{params.zhuSuLou},'%')
</if>
<if test=" params.dormitory != '' and params.dormitory != null and params.dormitory != 'null' ">
and yonghu.dormitory like CONCAT('%',#{params.dormitory},'%')
</if>
<if test=" params.role != '' and params.role != null and params.role != 'null' ">
and yonghu.role like CONCAT('%',#{params.role},'%')
</if>
<if test=" params.zdname != '' and params.zdname != null and params.zdname != 'null' ">
and zhandian.zdname like CONCAT('%',#{params.zdname},'%')
</if>
<if test=" params.address != '' and params.address != null and params.address != 'null' ">
and zhandian.address like CONCAT('%',#{params.address},'%')
</if>
</where>
order by a.id desc
</select>
</mapper>

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.DaiqurenDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.name as name
,a.username as username
,a.password as password
,a.sex_types as sexTypes
,a.img_photo as imgPhoto
,a.phone as phone
,a.role as role
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.DaiqurenView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
FROM daiquren a
<where>
<if test=" params.name != '' and params.name != null and params.name != 'null' ">
and a.name like CONCAT('%',#{params.name},'%')
</if>
<if test=" params.username != '' and params.username != null and params.username != 'null' ">
and a.username like CONCAT('%',#{params.username},'%')
</if>
<if test=" params.password != '' and params.password != null and params.password != 'null' ">
and a.password like CONCAT('%',#{params.password},'%')
</if>
<if test="params.sexTypes != null">
and a.sex_types = #{params.sexTypes}
</if>
<if test=" params.phone != '' and params.phone != null and params.phone != 'null' ">
and a.phone like CONCAT('%',#{params.phone},'%')
</if>
<if test=" params.role != '' and params.role != null and params.role != 'null' ">
and a.role like CONCAT('%',#{params.role},'%')
</if>
</where>
order by a.id desc
</select>
</mapper>

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.DictionaryDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.dic_code as dicCode
,a.dic_name as dicName
,a.code_index as codeIndex
,a.index_name as indexName
,a.super_id as superId
,a.create_time as createTime
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.DictionaryView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
FROM dictionary a
<where>
<if test=" params.dicCode != '' and params.dicCode != null and params.dicCode != 'null' ">
and a.dic_code like CONCAT('%',#{params.dicCode},'%')
</if>
<if test=" params.dicName != '' and params.dicName != null and params.dicName != 'null' ">
and a.dic_name like CONCAT('%',#{params.dicName},'%')
</if>
<if test="params.codeIndexStart != null">
<![CDATA[ and a.code_index >= #{params.codeIndexStart} ]]>
</if>
<if test="params.codeIndexEnd != null">
<![CDATA[ and a.code_index <= #{params.codeIndexEnd} ]]>
</if>
<if test=" params.indexName != '' and params.indexName != null and params.indexName != 'null' ">
and a.index_name like CONCAT('%',#{params.indexName},'%')
</if>
<if test="params.superId != null">
and a.super_id = #{params.superId}
</if>
</where>
order by a.id desc
</select>
</mapper>

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.JiedanDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.odd as odd
,a.daiqukuaidimc as daiqukuaidimc
,a.jdyonghu_id as jdyonghuId
,a.initiate_time as initiateTime
,a.addresseename as addresseename
,a.jdphone as jdphone
,a.jdaddressee as jdaddressee
,a.jdtakecode as jdtakecode
,a.jdzt_types as jdztTypes
,a.kdlx_types as kdlxTypes
,a.dx as dx
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.JiedanView" >
SELECT
<include refid="Base_Column_List" />,b.name as fbrname
-- 级联表的字段
FROM jiedan a left join yonghu b on a.jdyonghu_id = b.id
<where>
<if test=" params.odd != '' and params.odd != null and params.odd != 'null' ">
and a.odd like CONCAT('%',#{params.odd},'%')
</if>
<if test="params.daiqukuaidimc != null">
and a.daiqukuaidimc = #{params.daiqukuaidimc}
</if>
<if test="params.jdyonghuId != null">
and a.jdyonghu_id = #{params.jdyonghuId}
</if>
<if test=" params.initiateTimeStart != '' and params.initiateTimeStart != null ">
<![CDATA[ and DATE_FORMAT(a.initiate_time, '%Y-%m-%d %H:%T:%s') >=
DATE_FORMAT(#{params.initiateTimeStart}, '%Y-%m-%d %H:%T:%s') ]]>
</if>
<if test=" params.initiateTimeEnd != '' and params.initiateTimeEnd != null ">
<![CDATA[ and DATE_FORMAT(a.initiate_time, '%Y-%m-%d %H:%T:%s') <=
DATE_FORMAT(#{params.initiateTimeEnd} , '%Y-%m-%d %H:%T:%s') ]]>
</if>
<if test=" params.addresseename != '' and params.addresseename != null and params.addresseename != 'null' ">
and a.addresseename like CONCAT('%',#{params.addresseename},'%')
</if>
<if test=" params.jdphone != '' and params.jdphone != null and params.jdphone != 'null' ">
and a.jdphone like CONCAT('%',#{params.jdphone},'%')
</if>
<if test=" params.jdaddressee != '' and params.jdaddressee != null and params.jdaddressee != 'null' ">
and a.jdaddressee like CONCAT('%',#{params.jdaddressee},'%')
</if>
<if test=" params.jdtakecode != '' and params.jdtakecode != null and params.jdtakecode != 'null' ">
and a.jdtakecode like CONCAT('%',#{params.jdtakecode},'%')
</if>
<if test="params.jdztTypes != null">
and a.jdzt_types = #{params.jdztTypes}
</if>
<if test="params.kdlxTypes != null">
and a.kdlx_types = #{params.kdlxTypes}
</if>
</where>
order by a.id desc
</select>
</mapper>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.TokenDao">
<select id="selectListView"
resultType="com.entity.TokenEntity" >
SELECT t.* FROM token t
<where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.UserDao">
<select id="selectListView"
resultType="com.entity.UserEntity" >
SELECT u.* FROM users u
<where> 1=1 ${ew.sqlSegment}</where>
</select>
</mapper>

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.YijiedanDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.odd as odd
,a.yonghu_id as yonghuId
,a.fbphone as fbphone
,a.daiquren_id as daiqurenId
,a.jdphone as jdphone
,a.initiate_time as initiateTime
,a.ddzt_types as ddztTypes
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.YijiedanView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
,daiquren.name as yhname
,daiquren.username as username
,daiquren.password as password
,daiquren.sex_types as sexTypes
,daiquren.img_photo as imgPhoto
,daiquren.phone as phone
,daiquren.role as role
,yonghu.studentnumber as studentnumber
,yonghu.name as name
,yonghu.username as username
,yonghu.password as password
,yonghu.sex_types as sexTypes
,yonghu.img_photo as imgPhoto
,yonghu.phone as phone
,yonghu.zhuSuLou as zhuSuLou
,yonghu.dormitory as dormitory
,yonghu.role as role
FROM yijiedan a
left JOIN daiquren daiquren ON a.daiquren_id = daiquren.id
left JOIN yonghu yonghu ON a.yonghu_id = yonghu.id
<where>
<if test=" params.odd != '' and params.odd != null and params.odd != 'null' ">
and a.odd like CONCAT('%',#{params.odd},'%')
</if>
<if test="params.yonghuId != null">
and a.yonghu_id = #{params.yonghuId}
</if>
<if test=" params.fbphone != '' and params.fbphone != null and params.fbphone != 'null' ">
and a.fbphone like CONCAT('%',#{params.fbphone},'%')
</if>
<if test="params.daiqurenId != null">
and a.daiquren_id = #{params.daiqurenId}
</if>
<if test=" params.jdphone != '' and params.jdphone != null and params.jdphone != 'null' ">
and a.jdphone like CONCAT('%',#{params.jdphone},'%')
</if>
<if test=" params.initiateTimeStart != '' and params.initiateTimeStart != null ">
<![CDATA[ and DATE_FORMAT(a.initiate_time, '%Y-%m-%d %H:%T:%s') >=
DATE_FORMAT(#{params.initiateTimeStart}, '%Y-%m-%d %H:%T:%s') ]]>
</if>
<if test=" params.initiateTimeEnd != '' and params.initiateTimeEnd != null ">
<![CDATA[ and DATE_FORMAT(a.initiate_time, '%Y-%m-%d %H:%T:%s') <=
DATE_FORMAT(#{params.initiateTimeEnd} , '%Y-%m-%d %H:%T:%s') ]]>
</if>
<if test="params.ddztTypes != null">
and a.ddzt_types = #{params.ddztTypes}
</if>
<if test=" params.name != '' and params.name != null and params.name != 'null' ">
and daiquren.name like CONCAT('%',#{params.name},'%')
</if>
<if test=" params.username != '' and params.username != null and params.username != 'null' ">
and daiquren.username like CONCAT('%',#{params.username},'%')
</if>
<if test=" params.password != '' and params.password != null and params.password != 'null' ">
and daiquren.password like CONCAT('%',#{params.password},'%')
</if>
<if test="params.sexTypes != null">
and daiquren.sex_types = #{params.sexTypes}
</if>
<if test=" params.phone != '' and params.phone != null and params.phone != 'null' ">
and daiquren.phone like CONCAT('%',#{params.phone},'%')
</if>
<if test=" params.role != '' and params.role != null and params.role != 'null' ">
and daiquren.role like CONCAT('%',#{params.role},'%')
</if>
<if test=" params.studentnumber != '' and params.studentnumber != null and params.studentnumber != 'null' ">
and yonghu.studentnumber like CONCAT('%',#{params.studentnumber},'%')
</if>
<if test=" params.name != '' and params.name != null and params.name != 'null' ">
and yonghu.name like CONCAT('%',#{params.name},'%')
</if>
<if test=" params.username != '' and params.username != null and params.username != 'null' ">
and yonghu.username like CONCAT('%',#{params.username},'%')
</if>
<if test=" params.password != '' and params.password != null and params.password != 'null' ">
and yonghu.password like CONCAT('%',#{params.password},'%')
</if>
<if test="params.sexTypes != null">
and yonghu.sex_types = #{params.sexTypes}
</if>
<if test=" params.phone != '' and params.phone != null and params.phone != 'null' ">
and yonghu.phone like CONCAT('%',#{params.phone},'%')
</if>
<if test=" params.zhuSuLou != '' and params.zhuSuLou != null and params.zhuSuLou != 'null' ">
and yonghu.zhuSuLou like CONCAT('%',#{params.zhuSuLou},'%')
</if>
<if test=" params.dormitory != '' and params.dormitory != null and params.dormitory != 'null' ">
and yonghu.dormitory like CONCAT('%',#{params.dormitory},'%')
</if>
<if test=" params.role != '' and params.role != null and params.role != 'null' ">
and yonghu.role like CONCAT('%',#{params.role},'%')
</if>
</where>
order by a.id desc
</select>
</mapper>

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.YonghuDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.studentnumber as studentnumber
,a.name as name
,a.username as username
,a.password as password
,a.sex_types as sexTypes
,a.img_photo as imgPhoto
,a.yanzheng as yanzheng
,a.phone as phone
,a.zhuSuLou as zhuSuLou
,a.dormitory as dormitory
,a.role as role
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.YonghuView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
FROM yonghu a
<where>
<if test=" params.studentnumber != '' and params.studentnumber != null and params.studentnumber != 'null' ">
and a.studentnumber like CONCAT('%',#{params.studentnumber},'%')
</if>
<if test=" params.name != '' and params.name != null and params.name != 'null' ">
and a.name like CONCAT('%',#{params.name},'%')
</if>
<if test=" params.username != '' and params.username != null and params.username != 'null' ">
and a.username like CONCAT('%',#{params.username},'%')
</if>
<if test=" params.password != '' and params.password != null and params.password != 'null' ">
and a.password like CONCAT('%',#{params.password},'%')
</if>
<if test="params.sexTypes != null">
and a.sex_types = #{params.sexTypes}
</if>
<if test=" params.phone != '' and params.phone != null and params.phone != 'null' ">
and a.phone like CONCAT('%',#{params.phone},'%')
</if>
<if test=" params.zhuSuLou != '' and params.zhuSuLou != null and params.zhuSuLou != 'null' ">
and a.zhuSuLou like CONCAT('%',#{params.zhuSuLou},'%')
</if>
<if test=" params.dormitory != '' and params.dormitory != null and params.dormitory != 'null' ">
and a.dormitory like CONCAT('%',#{params.dormitory},'%')
</if>
<if test=" params.role != '' and params.role != null and params.role != 'null' ">
and a.role like CONCAT('%',#{params.role},'%')
</if>
</where>
order by a.id desc
</select>
</mapper>

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dao.ZhandianDao">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
a.id as id
,a.zdname as zdname
,a.address as address
</sql>
<select id="selectListView" parameterType="map" resultType="com.entity.view.ZhandianView" >
SELECT
<include refid="Base_Column_List" />
-- 级联表的字段
FROM zhandian a
<where>
<if test=" params.zdname != '' and params.zdname != null and params.zdname != 'null' ">
and a.zdname like CONCAT('%',#{params.zdname},'%')
</if>
<if test=" params.address != '' and params.address != null and params.address != 'null' ">
and a.address like CONCAT('%',#{params.address},'%')
</if>
</where>
order by a.id desc
</select>
</mapper>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD SQL Map Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--
| plugins在配置文件中的位置必须符合要求否则会报错顺序如下:
| properties?, settings?,
| typeAliases?, typeHandlers?,
| objectFactory?,objectWrapperFactory?,
| plugins?,
| environments?, databaseIdProvider?, mappers?
|-->
<configuration>
<!--
| 全局配置设置
|
| 可配置选项 默认值, 描述
|
| aggressiveLazyLoading true, 当设置为true的时候懒加载的对象可能被任何懒属性全部加载。否则每个属性都按需加载。
| multipleResultSetsEnabled true, 允许和不允许单条语句返回多个数据集(取决于驱动需求)
| useColumnLabel true, 使用列标签代替列名称。不同的驱动器有不同的作法。参考一下驱动器文档,或者用这两个不同的选项进行测试一下。
| useGeneratedKeys false, 允许JDBC 生成主键。需要驱动器支持。如果设为了true这个设置将强制使用被生成的主键有一些驱动器不兼容不过仍然可以执行。
| autoMappingBehavior PARTIAL, 指定MyBatis 是否并且如何来自动映射数据表字段与对象的属性。PARTIAL将只自动映射简单的没有嵌套的结果。FULL 将自动映射所有复杂的结果。
| defaultExecutorType SIMPLE, 配置和设定执行器SIMPLE 执行器执行其它语句。REUSE 执行器可能重复使用prepared statements 语句BATCH执行器可以重复执行语句和批量更新。
| defaultStatementTimeout null, 设置一个时限,以决定让驱动器等待数据库回应的多长时间为超时
| -->
<settings>
<!-- 这个配置使全局的映射器启用或禁用缓存 -->
<setting name="cacheEnabled" value="true"/>
<!-- 全局启用或禁用延迟加载。当禁用时,所有关联对象都会即时加载 -->
<setting name="lazyLoadingEnabled" value="true"/>
<setting name="multipleResultSetsEnabled" value="true"/>
<setting name="useColumnLabel" value="true"/>
<setting name="defaultExecutorType" value="REUSE"/>
<setting name="defaultStatementTimeout" value="25000"/>
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
</configuration>

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:default-servlet-handler/>
<!-- Controller包(自动注入) -->
<context:component-scan base-package="com.controller"/>
<!-- FastJson注入 -->
<mvc:annotation-driven>
<!-- <mvc:message-converters register-defaults="true">
避免IE执行AJAX时,返回JSON出现下载文件
FastJson
<bean id="fastJsonHttpMessageConverter"
class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
这里顺序不能反一定先写text/html,不然ie下出现下载提示
<value>text/html;charset=UTF-8</value>
<value>application/json;charset=UTF-8</value>
</list>
</property>
<property name="features">
<array value-type="com.alibaba.fastjson.serializer.SerializerFeature">
避免循环引用
<value>DisableCircularReferenceDetect</value>
是否输出值为null的字段
<value>WriteMapNullValue</value>
数值字段如果为null,输出为0,而非null
<value>WriteNullNumberAsZero</value>
字符类型字段如果为null,输出为"",而非null
<value>WriteNullStringAsEmpty</value>
List字段如果为null,输出为[],而非null
<value>WriteNullListAsEmpty</value>
Boolean字段如果为null,输出为false,而非null
<value>WriteNullBooleanAsFalse</value>
</array>
</property>
</bean>
</mvc:message-converters> -->
</mvc:annotation-driven>
<!-- 静态资源配置 -->
<mvc:resources mapping="/resources/**" location="/resources/"/>
<!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
<!-- 拦截器配置 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<mvc:exclude-mapping path="/upload"/>
<bean class="com.interceptor.AuthorizationInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
<!-- 上传限制 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 上传文件大小限制为31M31*1024*1024 -->
<property name="maxUploadSize" value="32505856"/>
</bean>
</beans>

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 配置数据源 -->
<bean name="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<property name="url" value="${jdbc_url}"/>
<property name="username" value="${jdbc_username}"/>
<property name="password" value="${jdbc_password}"/>
<!-- 初始化连接大小 -->
<property name="initialSize" value="0"/>
<!-- 连接池最大使用连接数量 -->
<property name="maxActive" value="20"/>
<!-- 连接池最大空闲 -->
<property name="maxIdle" value="20"/>
<!-- 连接池最小空闲 -->
<property name="minIdle" value="0"/>
<!-- 获取连接最大等待时间 -->
<property name="maxWait" value="60000"/>
<property name="validationQuery" value="${validationQuery}"/>
<property name="testOnBorrow" value="false"/>
<property name="testOnReturn" value="false"/>
<property name="testWhileIdle" value="true"/>
<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
<property name="timeBetweenEvictionRunsMillis" value="60000"/>
<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
<property name="minEvictableIdleTimeMillis" value="25200000"/>
<!-- 打开removeAbandoned功能 -->
<property name="removeAbandoned" value="true"/>
<!-- 1800秒也就是30分钟 -->
<property name="removeAbandonedTimeout" value="1800"/>
<!-- 关闭abanded连接时输出错误日志 -->
<property name="logAbandoned" value="true"/>
<!-- 监控数据库 -->
<property name="filters" value="mergeStat"/>
</bean>
<!-- Spring整合Mybatis更多查看文档http://mp.baomidou.com -->
<bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.spring.MybatisSqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<!-- 自动扫描Mapping.xml文件 -->
<property name="mapperLocations" value="classpath:mapper/*.xml"/>
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml"/>
<property name="typeAliasesPackage" value="com..model.*"/>
<property name="typeEnumsPackage" value="com.model.enums"/>
<property name="plugins">
<array>
<!-- 分页插件配置 -->
<bean id="paginationInterceptor" class="com.baomidou.mybatisplus.plugins.PaginationInterceptor">
</bean>
</array>
</property>
<!-- 全局配置注入 -->
<property name="globalConfig" ref="globalConfig" />
</bean>
<bean id="globalConfig" class="com.baomidou.mybatisplus.entity.GlobalConfiguration">
<!--
AUTO->`0`("数据库ID自增")
INPUT->`1`(用户输入ID")
ID_WORKER->`2`("全局唯一ID")
UUID->`3`("全局唯一ID")
-->
<property name="idType" value="2" />
<!--
MYSQL->`mysql`
ORACLE->`oracle`
DB2->`db2`
H2->`h2`
HSQL->`hsql`
SQLITE->`sqlite`
POSTGRE->`postgresql`
SQLSERVER2005->`sqlserver2005`
SQLSERVER->`sqlserver`
-->
<!-- Oracle需要添加该项 -->
<!-- <property name="dbType" value="oracle" /> -->
<!-- 全局表为下划线命名设置 true -->
<!-- <property name="dbColumnUnderline" value="true" /> -->
<property name="metaObjectHandler">
<bean class="com.config.MyMetaObjectHandler" />
</property>
</bean>
<!-- MyBatis 动态扫描 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.dao"/>
</bean>
<!-- 配置事务管理 -->
<bean name="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- 事务管理 属性 -->
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="append*" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="modify*" propagation="REQUIRED"/>
<tx:method name="edit*" propagation="REQUIRED"/>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="remove*" propagation="REQUIRED"/>
<tx:method name="repair" propagation="REQUIRED"/>
<tx:method name="get*" propagation="REQUIRED" read-only="true"/>
<tx:method name="find*" propagation="REQUIRED" read-only="true"/>
<tx:method name="load*" propagation="REQUIRED" read-only="true"/>
<tx:method name="search*" propagation="REQUIRED" read-only="true"/>
<tx:method name="datagrid*" propagation="REQUIRED" read-only="true"/>
<tx:method name="*" propagation="REQUIRED"/>
</tx:attributes>
</tx:advice>
<!-- 配置切面 -->
<aop:config>
<aop:pointcut id="transactionPointcut" expression="execution(* com.service..*.*(..))"/>
<aop:advisor pointcut-ref="transactionPointcut" advice-ref="transactionAdvice"/>
</aop:config>
</beans>

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<!-- 引入属性文件 -->
<context:property-placeholder location="classpath:config.properties"/>
<!-- Service包(自动注入) -->
<context:component-scan base-package="com.service"/>
<import resource="classpath:spring/spring-mybatis.xml"/>
</beans>

@ -0,0 +1,107 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>校园快递一站式服务系统</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/xznstatic/css/bootstrap4.2.1.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/xznstatic/css/style.default.css" id="theme-stylesheet">
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/assets2/js/jquery.min.js"></script>
</head>
<body>
<div class="page login-page">
<div class="container d-flex align-items-center">
<div class="form-holder has-shadow">
<div class="row">
<div class="col-lg-6">
<div class="info d-flex align-items-center">
<div class="content">
<div class="logo">
<h1>欢迎登录</h1>
</div>
<p>校园快递一站式服务系统</p>
</div>
</div>
</div>
<div class="col-lg-6 bg-white">
<div class="form d-flex align-items-center">
<div class="content">
<form id="loginForm" action="" method="post" class="form-validate">
<input type="text" required placeholder="用户名" id="username" name="username" class="input-material">
<input type="password" name="password" required placeholder="密码" class="input-material">
<div style="margin: 10px 0;" id="submitBtn"></div>
<button type="submit" class="btn btn-primary" onclick="login()">登录</button>
</br>
<a href="modules/register/register.jsp">注册</a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/bootstrap4.2.1.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/front.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript">
<%@ include file="utils/menu.jsp"%>
<%@ include file="utils/baseUrl.jsp"%>
var role = "";
var accountTableName = "";
//渲染角色选择
function setRoleOption() {
for (var i = 0; i < menus.length; i++) {
var divRoot = '<div class="custom-control custom-checkbox "><input type="radio" name="chk" class="custom-control-input" id="check' + i + '" value="' + menus[i].roleName + '" onclick="checkRole(\'' + menus[i].roleName + '\', \'' + menus[i].tableName + '\')"><label class="custom-control-label" for="check' + i + '">' + menus[i].roleName + '</label></div>';
$('#submitBtn').append(divRoot);
}
}
function checkRole(roleName, tableName) {
role = roleName;
$('#loginForm').attr('action', baseUrl + tableName + '/login?role='+role);
accountTableName = tableName;
}
function login() {
$("#loginForm").ajaxForm(function(res) {
if (role == "" || role == null) {
alert("请选择角色后再登录");
} else {
if (res.code == 0) {
alert("登录成功");
var username = $('#username').val();
window.sessionStorage.setItem('accountTableName',accountTableName)
window.sessionStorage.setItem('username',username);
window.sessionStorage.setItem('token', res.token);
window.sessionStorage.setItem('role', role);
window.location.href = "../index.jsp";
} else {
alert(res.msg);
}
}
});
}
function register(){
window.location.href = "modules/register/register.jsp"
}
function ready() {
setRoleOption();
}
document.addEventListener("DOMContentLoaded", ready);
</script>
</body>
</html>

@ -0,0 +1,16 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!-- Jquery -->
<script src="${ctx}/resources/jquery/jquery-2.2.3.min.js" type="text/javascript"></script>
<!-- Bootstrap -->
<link href="${ctx}/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<script src="${ctx}/resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script>
function toIndex() {
window.location.href = '${ctx}/';
}
</script>

@ -0,0 +1,83 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>用户列表</title>
<%@include file="common/include.jsp" %>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-lg-8">
<br/>
<div class="panel panel-default">
<div class="panel-body">
<button type="button" onclick="preSave()" class="btn btn-default">添加</button>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>姓名</th>
<th>年龄</th>
<th>类型</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="user" items="${userList}">
<tr>
<td>${user.id}</td>
<td>${user.name}</td>
<td>${user.age}</td>
<td>${user.type}</td>
<td>${user.ctime}</td>
<td>
<a href="javascript:void(0);" onclick="preSave('${user.id}')" title="编辑">
<i class="glyphicon glyphicon-edit"></i>
</a>
<a href="javascript:void(0);" onclick="del('${user.id}')" title="删除">
<i class="glyphicon glyphicon-remove"></i>
</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
</div>
<script>
function preSave(id) {
if (id == undefined || id == null || id == '') {
window.location.href = '${ctx}/preSave';
} else {
window.location.href = '${ctx}/preSave?id=' + id;
}
}
function del(id) {
$.ajax({
type: 'POST',
url: '${ctx}/delete',
data: {
id: id
},
dataType: 'json',
success: function (data) {
alert(data.msg);
if (data.success) {
setTimeout('toIndex()', 100);
}
},
error: function () {
alert("出错了,请重试!");
}
});
}
</script>
</body>
</html>

@ -0,0 +1,49 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
<title>编辑</title>
<%@include file="common/include.jsp" %>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-lg-8">
<form id="form" role="form">
<input id="id" name="id" value="${user.id}" hidden>
<div class="form-group">
<label for="name">姓名</label>
<input type="text" class="form-control" id="name" name="name" value="${user.name}" placeholder="请输入姓名">
</div>
<div class="form-group">
<label for="age">年龄</label>
<input type="text" class="form-control" id="age" name="age" value="${user.age}" placeholder="请输入年龄">
</div>
<button type="button" onclick="save()" class="btn btn-default">保存</button>
<button type="reset" class="btn btn-default">取消</button>
</form>
</div>
</div>
</div>
<script>
function save() {
$.ajax({
type: 'POST',
url: '${ctx}/save',
data: $('#form').serialize(),
dataType: 'json',
success: function (data) {
alert(data.msg);
if (data.success) {
setTimeout('toIndex()', 100);
}
},
error: function () {
alert("出错了,请重试!");
}
});
}
</script>
</body>
</html>

@ -0,0 +1,179 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="static/head.jsp"%>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="static/topNav.jsp"%>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">支付</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="${pageContext.request.contextPath}/index.jsp"> <span
class="ti-home"></span>
</a></li>
<li class="breadcrumb-item">支付</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">请选择支付方式</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios" checked>
<img src="${pageContext.request.contextPath}/resources/images/bank/微信支付.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/支付宝支付.png" width="200" height="100">
</div>
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/交通银行.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/招商银行.png" width="200" height="100">
</div>
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国农业银行.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国建设银行.png" width="200" height="100">
</div>
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国银行.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国邮政储蓄银行.png" width="200" height="100">
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-6 mb-3">
<button id="submitBtn" type="button"
class="btn btn-primary btn-lg">支付</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top"> <span
class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="static/foot.jsp"%>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="utils/menu.jsp"%>
<%@ include file="static/setMenu.js"%>
<%@ include file="utils/baseUrl.jsp"%>
var tableName = "";
var pageType = "pay";
function pay() {
updateId = window.sessionStorage.getItem('oId')
var tableName = window.sessionStorage.getItem('tableName')
$.ajax({
type: "POST",
url: baseUrl + tableName +"/update",
contentType: "application/json",
data:JSON.stringify({id: updateId, ispay: "已支付"}),
beforeSend: function(xhr) {xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));},
success: function(res){
if(res.code == 0){
window.sessionStorage.removeItem('id');
window.sessionStorage.removeItem('tableName');
alert('支付成功');
window.location.href= "modules/" + tableName +"/list.jsp";
}else if(res.code == 401){
<%@ include file="static/toLogin.jsp"%>
}else{
alert(res.msg)
}
},
});      
}
$(document).ready(function() {
//设置导航栏菜单
setMenu();
$('#submitBtn').on('click', function(e) {
e.preventDefault();
//console.log("点击了...提交按钮");
pay();
});
<%@ include file="static/myInfo.js"%>
});
// 用户登出
<%@ include file="static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>spring</display-name>
<!-- 加载Spring配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring.xml</param-value>
</context-param>
<!-- 字符集 过滤器 -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Spring监听器 -->
<listener>
<description>Spring监听器</description>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 防止Spring内存溢出监听器 -->
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<!-- Spring MVC -->
<servlet>
<servlet-name>SpringMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<description>SpringMVC</description>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- 本次需要做的配置注意位置要放在配置springmvc的url-pattern之前 -->
<!-- 表示当程序加载符合这些路径的资源时不会通过dispatchservlet -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
<url-pattern>*.css</url-pattern>
<url-pattern>*.html</url-pattern>
<url-pattern>/upload/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SpringMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- Session超时时间 -->
<!-- <session-config>
<session-timeout>15</session-timeout>
</session-config> -->
<!-- 字典表初始化 -->
<listener>
<description>字典表初始化监听器</description>
<listener-class>com.ServletContextListener.DictionaryServletContextListener</listener-class>
</listener>
</web-app>

@ -0,0 +1,125 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>入口页</title>
<link href="${pageContext.request.contextPath}/resources/xznstatic/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
<link href="${pageContext.request.contextPath}/resources/xznstatic/css/jquery.toast.min.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/resources/xznstatic/css/style.css" rel="stylesheet" type="text/css">
</head>
<style>
</style>
<body>
<div class="preloader-it">
<div class="la-anim-1"></div>
</div>
<div class="wrapper theme-1-active pimary-color-blue">
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="mobile-only-brand pull-left">
<div class="nav-header pull-left">
<div class="logo-wrap">
<a href="#"><span class="brand-text" id="pName"></span></a>
</div>
</div><a id="toggle_nav_btn" class="toggle-left-nav-btn inline-block ml-20 pull-left"
href="javascript:void(0);"><i class="zmdi zmdi-menu"></i></a><a id="toggle_mobile_search"
data-toggle="collapse" data-target="#search_form" class="mobile-only-view"
href="javascript:void(0);"><i class="zmdi zmdi-search"></i></a><a id="toggle_mobile_nav"
class="mobile-only-view" href="javascript:void(0);"><i class="zmdi zmdi-more"></i></a>
</div>
<div id="mobile_only_nav" class="mobile-only-nav pull-right">
<ul class="nav navbar-right top-nav pull-right">
<li class="dropdown auth-drp"><a href="#" class="dropdown-toggle pr-0" data-toggle="dropdown"><img
src="${pageContext.request.contextPath}/resources/xznstatic/img/user1.png" alt="user_auth" class="user-auth-img img-circle" /><span
class="user-online-status"></span></a>
<ul class="dropdown-menu user-auth-dropdown" data-dropdown-in="flipInX"
data-dropdown-out="flipOutX">
<li><a href="#" onclick="logout()"><i class="zmdi zmdi-power"></i><span>退出</span></a></li>
</ul>
</li>
</ul>
</div>
</nav>
<div class="fixed-sidebar-left">
<ul class="nav navbar-nav side-nav nicescroll-bar" id="side-menu">
<li>
<a href="${pageContext.request.contextPath}/jsp/modules/home/home.jsp" onclick="navClick(this);return false;">
<div class="pull-left">
<i class="zmdi zmdi-flag mr-20"></i>
<span class="right-nav-text">主页</span>
</div>
<div class="clearfix"></div>
</a>
</li>
</ul>
</div>
<div class="page-wrapper">
<div class="container-fluid pt-30">
<iframe id="mainIframe" src="${pageContext.request.contextPath}/jsp/modules/home/home.jsp" width="100%" frameborder="0" scrolling="auto" ></iframe>
</div>
<footer class="footer container-fluid pl-30 pr-30">
<div class="row">
<div class="col-sm-12">
<p id="copyright" style="text-align: center;"></p>
</div>
</div>
</footer>
</div>
</div>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.slimscroll.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.waypoints.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.counterup.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/dropdown-bootstrap-extended.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.sparkline.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/owl.carousel.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/switchery.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/echarts-en.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/echarts-liquidfill.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.toast.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/init.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/dashboard-data.js"></script>
<script>
<%@ include file = "jsp/utils/menu.jsp" %>
<%@ include file = "jsp/static/setMenu.js" %>
<%@ include file = "jsp/utils/baseUrl.jsp" %>
// 用户登出
<%@ include file = "jsp/static/logout.jsp" %>
$(document).ready(function () {
//我的后台,session信息转移
if (window.localStorage.getItem("Token") != null && window.localStorage.getItem("Token") != 'null') {
if (window.sessionStorage.getItem("token") == null || window.sessionStorage.getItem("token") ==
'null') {
window.sessionStorage.setItem("token", window.localStorage.getItem("Token"));
window.sessionStorage.setItem("role", window.localStorage.getItem("role"));
window.sessionStorage.setItem("accountTableName", window.localStorage.getItem("sessionTable"));
window.sessionStorage.setItem("username", window.localStorage.getItem("adminName"));
}
}
$('.dropdown-toggle .hidden-xs').html(window.sessionStorage.getItem('username'));
$('#pName').text(projectName);
$('#copyright').text('欢迎使用' + projectName)
var token = window.sessionStorage.getItem("token");
if (token == "null" || token == null) {
alert("请登录后再操作");
window.location.href = ("jsp/login.jsp");
}
setMenu();
});
</script>
</body>
</html>

@ -0,0 +1,107 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>校园快递一站式服务系统</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/xznstatic/css/bootstrap4.2.1.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/xznstatic/css/style.default.css" id="theme-stylesheet">
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/assets2/js/jquery.min.js"></script>
</head>
<body>
<div class="page login-page">
<div class="container d-flex align-items-center">
<div class="form-holder has-shadow">
<div class="row">
<div class="col-lg-6">
<div class="info d-flex align-items-center">
<div class="content">
<div class="logo">
<h1>欢迎登录</h1>
</div>
<p>校园快递一站式服务系统</p>
</div>
</div>
</div>
<div class="col-lg-6 bg-white">
<div class="form d-flex align-items-center">
<div class="content">
<form id="loginForm" action="" method="post" class="form-validate">
<input type="text" required placeholder="用户名" id="username" name="username" class="input-material">
<input type="password" name="password" required placeholder="密码" class="input-material">
<div style="margin: 10px 0;" id="submitBtn"></div>
<button type="submit" class="btn btn-primary" onclick="login()">登录</button>
</br>
<a href="modules/register/register.jsp">注册</a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/bootstrap4.2.1.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.validate.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/front.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript">
<%@ include file="utils/menu.jsp"%>
<%@ include file="utils/baseUrl.jsp"%>
var role = "";
var accountTableName = "";
//渲染角色选择
function setRoleOption() {
for (var i = 0; i < menus.length; i++) {
var divRoot = '<div class="custom-control custom-checkbox "><input type="radio" name="chk" class="custom-control-input" id="check' + i + '" value="' + menus[i].roleName + '" onclick="checkRole(\'' + menus[i].roleName + '\', \'' + menus[i].tableName + '\')"><label class="custom-control-label" for="check' + i + '">' + menus[i].roleName + '</label></div>';
$('#submitBtn').append(divRoot);
}
}
function checkRole(roleName, tableName) {
role = roleName;
$('#loginForm').attr('action', baseUrl + tableName + '/login?role='+role);
accountTableName = tableName;
}
function login() {
$("#loginForm").ajaxForm(function(res) {
if (role == "" || role == null) {
alert("请选择角色后再登录");
} else {
if (res.code == 0) {
alert("登录成功");
var username = $('#username').val();
window.sessionStorage.setItem('accountTableName',accountTableName)
window.sessionStorage.setItem('username',username);
window.sessionStorage.setItem('token', res.token);
window.sessionStorage.setItem('role', role);
window.location.href = "../index.jsp";
} else {
alert(res.msg);
}
}
});
}
function register(){
window.location.href = "modules/register/register.jsp"
}
function ready() {
setRoleOption();
}
document.addEventListener("DOMContentLoaded", ready);
</script>
</body>
</html>

@ -0,0 +1,257 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp"%>
<link
href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp"%>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑个人信息</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="${pageContext.request.contextPath}/index.jsp"> <span
class="ti-home"></span>
</a></li>
<li class="breadcrumb-item">个人信息管理</li>
<li class="breadcrumb-item active">编辑个人信息</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">个人信息信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>用户名</label> <input id="username" name="username"
class="form-control" placeholder="用户名">
</div>
<div class="form-group col-md-6 mb-3">
<button id="submitBtn" type="button"
class="btn btn-primary btn-lg" style="margin-top: 30px;">提交</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top"> <span
class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp"%>
<script
src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "";
var pageType = "add-or-update";
var updateId = "";
var accountTableName = ''
var ruleForm = {};
// 表单提交
function submit() {
if (validform() == true) {
$.ajax({
type : "POST",
url : baseUrl + accountTableName + "/update",
contentType : "application/json",
data : JSON.stringify({id: updateId,username: $('#username').val()}),
beforeSend : function(xhr) {
xhr.setRequestHeader("token", window.sessionStorage
.getItem('token'));
},
success : function(res) {
if (res.code == 0) {
alert("修改成功");
window.sessionStorage.setItem('username',$('#username').val())
window.location.reload();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
} else {
alert("表单未填完整或有错误");
}
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules : {
username: {
required : true,
},
},
messages : {
username: {
required : "用户名不能为空",
},
}
}).form();
}
// 添加表单校验方法
function addValidation() {
jQuery.validator
.addMethod(
"isPhone",
function(value, element) {
var length = value.length;
var mobile = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
return this.optional(element)
|| (length == 11 && mobile.test(value));
}, "请填写正确的手机号码");
jQuery.validator.addMethod("isIdCardNo", function(value, element) {
return this.optional(element)
|| idCardNoUtil.checkIdCardNo(value);
}, "请正确输入您的身份证号码");
}
function getId() {
var userName = window.sessionStorage.getItem('username')
accountTableName = window.sessionStorage.getItem('accountTableName')
$.ajax({
type : "GET",
url : baseUrl + accountTableName + "/page",
data : {
username : userName
},
beforeSend : function(xhr) {
xhr.setRequestHeader("token", window.sessionStorage
.getItem('token'));
},
success : function(res) {
if (res.code == 0) {
updateId = res.data.list[0].id
$('#username').val(res.data.list[0].username)
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg);
}
},
});
}
$(document).ready(function() {
//设置导航栏菜单
setMenu();
//添加表单校验信息文本
addValidation();
getId();
$('#submitBtn').on('click', function(e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,246 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp"%>
<link
href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp"%>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑修改密码</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="${pageContext.request.contextPath}/index.jsp"> <span
class="ti-home"></span>
</a></li>
<li class="breadcrumb-item">修改密码管理</li>
<li class="breadcrumb-item active">编辑修改密码</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">修改密码信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>原密码</label> <input id="oldPassword" name="oldPassword"
class="form-control" placeholder="原密码">
</div>
<div class="form-group col-md-6">
<label>新密码</label> <input id="newPassword" name="newPassword"
class="form-control" placeholder="新密码">
</div>
<div class="form-group col-md-6">
<label>确认密码</label> <input id="confirmPassword"
name="confirmPassword" class="form-control"
placeholder="确认密码">
</div>
<div class="form-group col-md-6 mb-3">
<button id="submitBtn" type="button"
class="btn btn-primary btn-lg" style="margin-top: 30px;">提交</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top"> <span
class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp"%>
<script
src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "xiugaimima";
var pageType = "add-or-update";
var updateId = "";
var password = '';
var accountTableName = ''
var ruleForm = {};
// 表单提交
function submit() {
if (validform() == true) {
if(password == $('#oldPassword').val()){
httpJson(accountTableName + "/update","POST",{
id:updateId,
mima: $('#newPassword').val(),
password: $('#newPassword').val()
},(res)=>{
if(res.code == 0){
window.location.href = '../../login.jsp';
alert('修改成功,请重新登陆');
}
});
}else{
alert('原密码输入错误')
}
} else {
alert("表单未填完整或有错误");
}
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules : {
oldPassword : {
required : true,
},
newPassword : {
required : true,
},
confirmPassword : {
required : true,
equalTo: "#newPassword",
},
},
messages : {
oldPassword : {
required : "原密码不能为空",
},
newPassword : {
required : "新密码不能为空",
},
confirmPassword : {
required : "确认密码不能为空",
equalTo: "两次密码输入不一致",
},
}
}).form();
}
function getId() {
var userName = window.sessionStorage.getItem('username')
accountTableName = window.sessionStorage.getItem('accountTableName')
http(accountTableName+'/session','GET',{},(res)=>{
if(res.code == 0){
updateId = res.data.id;
if(res.data != null && res.data.mima != null && res.data.mima != ''){
password = res.data.mima;
} else if(res.data != null && res.data.password != null && res.data.password != ''){
password = res.data.password;
}
}
});
}
$(document).ready(function() {
//设置导航栏菜单
setMenu();
getId();
$('#submitBtn').on('click', function(e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,683 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap-select.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑待取件表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">待取件表管理</li>
<li class="breadcrumb-item active">编辑待取件表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">待取件表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表的字段 -->
<div class="form-group col-md-6">
<label></label>
<div>
<select id="yonghuSelect" name="yonghuSelect"
class="selectpicker form-control" data-live-search="true"
title="请选择" data-header="请选择" data-size="5">
</select>
</div>
</div>
<div class="form-group col-md-6">
<label>学号</label>
<input id="studentnumber" name="studentnumber" class="form-control"
placeholder="学号" readonly>
</div>
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
placeholder="用户名称" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
placeholder="性别" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" src="" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>快递站点</label>
<div>
<select id="zhandianSelect" name="zhandianSelect"
class="selectpicker form-control" data-live-search="true"
title="请选择" data-header="请选择" data-size="5">
</select>
</div>
</div>
<div class="form-group col-md-6">
<label>站点地址</label>
<input id="address" name="address" class="form-control"
placeholder="站点地址" readonly>
</div>
<!-- 当前表的字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>快递名称</label>
<input id="dqname" name="dqname" class="form-control"
placeholder="快递名称">
</div>
<input id="zhandianId" name="zhandianId" type="hidden">
<input id="yonghuId" name="yonghuId" type="hidden">
<div class="form-group col-md-6">
<label>快递大小</label>
<select id="kddxTypesSelect" name="kddxTypes" class="form-control">
</select>
</div>
<div class="form-group col-md-6">
<label>手机号</label>
<input id="dqphone" name="dqphone" class="form-control"
onchange="dqphoneChickValue(this)" placeholder="手机号">
</div>
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">提交</button>
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js">
</script><script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap-select.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "daiqu";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
// 下拉框数组
<!-- 当前表的下拉框数组 -->
var kddxTypesOptions = [];
var kdztTypesOptions = [];
<!-- 级联表的下拉框数组 -->
var yonghuOptions = [];
var zhandianOptions = [];
var ruleForm = {};
// 文件上传
function upload() {
<!-- 当前表的文件上传 -->
}
// 表单提交
function submit() {
if (validform() == true && compare() == true) {
let data = {};
getContent();
if($("#zhandianId") !=null){
var zhandianId = $("#zhandianId").val();
if(zhandianId == null || zhandianId =='' || zhandianId == 'null'){
alert("站点不能为空");
return;
}
}
if($("#yonghuId") !=null){
var yonghuId = $("#yonghuId").val();
if(yonghuId == null || yonghuId =='' || yonghuId == 'null'){
alert("用户不能为空");
return;
}
}
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
var urlParam;
var successMes = '';
if (updateId != null && updateId != "null" && updateId != '') {
urlParam = 'update';
successMes = '修改成功';
} else {
urlParam = 'save';
successMes = '添加成功';
}
httpJson("daiqu/" + urlParam, "POST", data, (res) => {
if(res.code == 0)
{
window.sessionStorage.removeItem('adddaiqu');
window.sessionStorage.removeItem('updateId');
let flag = true;
if (flag) {
alert(successMes);
}
if (window.sessionStorage.getItem('onlyme') != null && window.sessionStorage.getItem('onlyme') == "true") {
window.sessionStorage.removeItem('onlyme');
window.sessionStorage.setItem("reload","reload");
window.parent.location.href = "${pageContext.request.contextPath}/index.jsp";
} else {
window.location.href = "list.jsp";
}
}
});
} else {
alert("表单未填完整或有错误");
}
}
// 查询列表
<!-- 查询当前表的所有列表 -->
function kddxTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=kddx_types", "GET", {}, (res) => {
if(res.code == 0){
kddxTypesOptions = res.data.list;
}
});
}
function kdztTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=kdzt_types", "GET", {}, (res) => {
if(res.code == 0){
kdztTypesOptions = res.data.list;
}
});
}
<!-- 查询级联表的所有列表 -->
function yonghuSelect() {
//填充下拉框选项
http("yonghu/page?page=1&limit=100&sort=&order=", "GET", {}, (res) => {
if(res.code == 0){
yonghuOptions = res.data.list;
}
});
}
function yonghuSelectOne(id) {
http("yonghu/info/"+id, "GET", {}, (res) => {
if(res.code == 0){
ruleForm = res.data;
yonghuShowImg();
yonghuDataBind();
}
});
}
function zhandianSelect() {
//填充下拉框选项
http("zhandian/page?page=1&limit=100&sort=&order=", "GET", {}, (res) => {
if(res.code == 0){
zhandianOptions = res.data.list;
}
});
}
function zhandianSelectOne(id) {
http("zhandian/info/"+id, "GET", {}, (res) => {
if(res.code == 0){
ruleForm = res.data;
zhandianShowImg();
zhandianDataBind();
}
});
}
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
function initializationKddxtypesSelect(){
var kddxTypesSelect = document.getElementById('kddxTypesSelect');
if(kddxTypesSelect != null && kddxTypesOptions != null && kddxTypesOptions.length > 0 ){
for (var i = 0; i < kddxTypesOptions.length; i++) {
kddxTypesSelect.add(new Option(kddxTypesOptions[i].indexName,kddxTypesOptions[i].codeIndex));
}
}
}
function initializationKdzttypesSelect(){
var kdztTypesSelect = document.getElementById('kdztTypesSelect');
if(kdztTypesSelect != null && kdztTypesOptions != null && kdztTypesOptions.length > 0 ){
for (var i = 0; i < kdztTypesOptions.length; i++) {
kdztTypesSelect.add(new Option(kdztTypesOptions[i].indexName,kdztTypesOptions[i].codeIndex));
}
}
}
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
function initializationyonghuSelect() {
var yonghuSelect = document.getElementById('yonghuSelect');
if(yonghuSelect != null && yonghuOptions != null && yonghuOptions.length > 0 ) {
for (var i = 0; i < yonghuOptions.length; i++) {
yonghuSelect.add(new Option(yonghuOptions[i].name, yonghuOptions[i].id));
}
$("#yonghuSelect").change(function(e) {
yonghuSelectOne(e.target.value);
});
}
}
function initializationzhandianSelect() {
var zhandianSelect = document.getElementById('zhandianSelect');
if(zhandianSelect != null && zhandianOptions != null && zhandianOptions.length > 0 ) {
for (var i = 0; i < zhandianOptions.length; i++) {
zhandianSelect.add(new Option(zhandianOptions[i].zdname, zhandianOptions[i].id));
}
$("#zhandianSelect").change(function(e) {
zhandianSelectOne(e.target.value);
});
}
}
// 下拉框选项回显
function setSelectOption() {
<!-- 当前表的下拉框回显 -->
var kddxTypesSelect = document.getElementById("kddxTypesSelect");
if(kddxTypesSelect != null && kddxTypesOptions != null && kddxTypesOptions.length > 0 ) {
for (var i = 0; i < kddxTypesOptions.length; i++) {
if (kddxTypesOptions[i].codeIndex == ruleForm.kddxTypes) {//下拉框value对比,如果一致就赋值汉字
kddxTypesSelect.options[i].selected = true;
}
}
}
var kdztTypesSelect = document.getElementById("kdztTypesSelect");
if(kdztTypesSelect != null && kdztTypesOptions != null && kdztTypesOptions.length > 0 ) {
for (var i = 0; i < kdztTypesOptions.length; i++) {
if (kdztTypesOptions[i].codeIndex == ruleForm.kdztTypes) {//下拉框value对比,如果一致就赋值汉字
kdztTypesSelect.options[i].selected = true;
}
}
}
<!-- 级联表的下拉框回显 -->
var yonghuSelect = document.getElementById("yonghuSelect");
if(yonghuSelect != null && yonghuOptions != null && yonghuOptions.length > 0 ) {
for (var i = 0; i < yonghuOptions.length; i++) {
if (yonghuOptions[i].id == ruleForm.yonghuId) {//下拉框value对比,如果一致就赋值汉字
yonghuSelect.options[i+1].selected = true;
$("#yonghuSelect" ).selectpicker('refresh');
}
}
}
var zhandianSelect = document.getElementById("zhandianSelect");
if(zhandianSelect != null && zhandianOptions != null && zhandianOptions.length > 0 ) {
for (var i = 0; i < zhandianOptions.length; i++) {
if (zhandianOptions[i].id == ruleForm.zhandianId) {//下拉框value对比,如果一致就赋值汉字
zhandianSelect.options[i+1].selected = true;
$("#zhandianSelect" ).selectpicker('refresh');
}
}
}
}
// 填充富文本框
function setContent() {
<!-- 当前表的填充富文本框 -->
}
// 获取富文本框内容
function getContent() {
<!-- 获取当前表的富文本框内容 -->
}
//数字检查
<!-- 当前表的数字检查 -->
function dqphoneChickValue(e){
var this_val = e.value || 0;
/*if(this_val == 0){
e.value = "";
alert("0不允许输入");
return false;
}*/
var reg=/^[0-9]*$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('adddaiqu');
window.location.href = "list.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
dqname: "required",
zhandianId: "required",
yonghuId: "required",
kddxTypes: "required",
dqphone: "required",
takecode: "required",
kdztTypes: "required",
pickupTime: "required",
},
messages: {
dqname: "快递名称不能为空",
zhandianId: "站点不能为空",
yonghuId: "用户不能为空",
kddxTypes: "快递大小不能为空",
dqphone: "手机号不能为空",
takecode: "取件码不能为空",
kdztTypes: "快递状态不能为空",
pickupTime: "取件时间不能为空",
}
}).form();
}
// 获取当前详情
function getDetails() {
var adddaiqu = window.sessionStorage.getItem("adddaiqu");
if (adddaiqu != null && adddaiqu != "" && adddaiqu != "null") {
window.sessionStorage.removeItem('adddaiqu');
//注册表单验证
$(validform());
$('#submitBtn').text('新增');
} else {
$('#submitBtn').text('修改');
var userId = window.sessionStorage.getItem('userId');
updateId = userId;//先赋值登录用户id
var uId = window.sessionStorage.getItem('updateId');//获取修改传过来的id
if (uId != null && uId != "" && uId != "null") {
//如果修改id不为空就赋值修改id
updateId = uId;
}
window.sessionStorage.removeItem('updateId');
http("daiqu/info/" + updateId, "GET", {}, (res) => {
if(res.code == 0)
{
ruleForm = res.data
// 是/否下拉框回显
setSelectOption();
// 设置图片src
showImg();
// 数据填充
dataBind();
// 富文本框回显
setContent();
//注册表单验证
$(validform());
}
});
}
}
// 清除可能会重复渲染的selection
function clear(className) {
var elements = document.getElementsByClassName(className);
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
function dateTimePick() {
}
function dataBind() {
<!-- 级联表的数据回显 -->
yonghuDataBind();
zhandianDataBind();
<!-- 当前表的数据回显 -->
$("#updateId").val(ruleForm.id);
$("#dqname").val(ruleForm.dqname);
$("#zhandianId").val(ruleForm.zhandianId);
$("#yonghuId").val(ruleForm.yonghuId);
$("#dqphone").val(ruleForm.dqphone);
$("#takecode").val(ruleForm.takecode);
$("#pickupTime-input").val(ruleForm.pickupTime);
}
<!-- 级联表的数据回显 -->
function yonghuDataBind(){
<!-- 把id赋值给当前表的id-->
$("#yonghuId").val(ruleForm.id);
$("#studentnumber").val(ruleForm.studentnumber);
$("#name").val(ruleForm.name);
$("#username").val(ruleForm.username);
$("#password").val(ruleForm.password);
$("#sexValue").val(ruleForm.sexValue);
$("#dqphone").val(ruleForm.phone);
$("#zhuSuLou").val(ruleForm.zhuSuLou);
$("#dormitory").val(ruleForm.dormitory);
$("#role").val(ruleForm.role);
}
function zhandianDataBind(){
<!-- 把id赋值给当前表的id-->
$("#zhandianId").val(ruleForm.id);
$("#zdname").val(ruleForm.zdname);
$("#address").val(ruleForm.address);
}
//图片显示
function showImg() {
<!-- 当前表的图片 -->
<!-- 级联表的图片 -->
yonghuShowImg();
zhandianShowImg();
}
<!-- 级联表的图片 -->
function yonghuShowImg() {
debugger
$("#imgPhotoImg").attr("src",ruleForm.imgPhoto);
}
function zhandianShowImg() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
//设置导航栏菜单
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
//初始化时间插件
dateTimePick();
//查询所有下拉框
<!-- 当前表的下拉框 -->
kddxTypesSelect();
kdztTypesSelect();
<!-- 查询级联表的下拉框(用id做option,用名字及其他参数做名字级联修改) -->
yonghuSelect();
zhandianSelect();
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
initializationKddxtypesSelect();
initializationKdzttypesSelect();
<!-- 初始化级联表的下拉框 -->
initializationyonghuSelect();
initializationzhandianSelect();
$(".selectpicker" ).selectpicker('refresh');
getDetails();
//初始化上传按钮
upload();
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
readonly();
});
function readonly() {
if (window.sessionStorage.getItem('role') != '管理员') {
$('#jifen').attr('readonly', 'readonly');
//$('#money').attr('readonly', 'readonly');
}
}
//比较大小
function compare() {
var largerVal = null;
var smallerVal = null;
if (largerVal != null && smallerVal != null) {
if (largerVal <= smallerVal) {
alert(smallerName + '不能大于等于' + largerName);
return false;
}
}
return true;
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,327 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" id="navUl">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑待取件表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">待取件表管理</li>
<li class="breadcrumb-item active">待取件表登记</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">待取件表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表所有字段 -->
<div class="form-group col-md-6">
<label>学号</label>
<input id="studentnumber" name="studentnumber" class="form-control"
v-model="ruleForm.studentnumber" readonly>
</div>
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
v-model="ruleForm.name" readonly>
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
v-model="ruleForm.username" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
v-model="ruleForm.sexValue" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
v-model="ruleForm.phone" readonly>
</div>
<div class="form-group col-md-6">
<label>住宿楼栋</label>
<input id="zhuSuLou" name="zhuSuLou" class="form-control"
v-model="ruleForm.zhuSuLou" readonly>
</div>
<div class="form-group col-md-6">
<label>寝室号</label>
<input id="dormitory" name="dormitory" class="form-control"
v-model="ruleForm.dormitory" readonly>
</div>
<div class="form-group col-md-6">
<label>身份</label>
<input id="role" name="role" class="form-control"
v-model="ruleForm.role" readonly>
</div>
<div class="form-group col-md-6">
<label>站点名称</label>
<input id="zdname" name="zdname" class="form-control"
v-model="ruleForm.zdname" readonly>
</div>
<div class="form-group col-md-6">
<label>站点地址</label>
<input id="address" name="address" class="form-control"
v-model="ruleForm.address" readonly>
</div>
<!-- 本表所有字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>快递名称</label>
<input id="dqname" name="dqname" class="form-control"
v-model="ruleForm.dqname" readonly>
</div>
<input id="zhandianId" name="zhandianId" v-model="ruleForm.zhandianId" readonly type="hidden">
<input id="yonghuId" name="yonghuId" v-model="ruleForm.yonghuId" readonly type="hidden">
<div class="form-group col-md-6">
<label>快递大小</label>
<input id="kddxValue" name="kddxValue" class="form-control"
v-model="ruleForm.kddxValue" readonly>
</div>
<div class="form-group col-md-6">
<label>手机号</label>
<input id="dqphone" name="dqphone" class="form-control"
v-model="ruleForm.dqphone" readonly>
</div>
<div class="form-group col-md-6">
<label>取件码</label>
<input id="takecode" name="takecode" class="form-control"
v-model="ruleForm.takecode" readonly>
</div>
<div class="form-group col-md-6">
<label>快递状态</label>
<input id="kdztValue" name="kdztValue" class="form-control"
v-model="ruleForm.kdztValue" readonly>
</div>
<div class="form-group col-md-6">
<label>取件时间</label>
<input id="pickupTime" name="pickupTime" class="form-control"
v-model="ruleForm.pickupTime" readonly>
</div>
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "daiqu";
var pageType = "add-or-update";
var updateId = "";
var kddxTypesOptions = [];
var kdztTypesOptions = [];
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "daiqu/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
ruleForm = res.data;
showImg();
setContent();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 填充富文本框
function setContent() {
}
//图片显示
function showImg() {
$("#imgPhotoImg").attr("src", ruleForm.imgPhoto);
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('adddaiqu');
window.location.href = "list.jsp";
}
// 下载
function download(fileName) {
var url = baseUrl+'file/download?fileName='+fileName;
window.open(url);
}
//设置下载
function setDownloadBtn() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,757 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">待取件表管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">待取件表管理</li>
<li class="breadcrumb-item active">待取件表列表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">待取件表列表</h3>
<div class="table-responsive mb-3">
<div class="col-sm-12">
<label>
快递名称
<input type="text" id="dqnameSearch" style="width: 140px;" class="form-control form-control-sm"
placeholder="快递名称" aria-controls="tableId">
</label>
<label>
快递大小
<select name="kddxTypesSelectSearch" style="width: 100px;" id="kddxTypesSelectSearch" class="form-control form-control-sm"
aria-controls="tableId">
</select>
</label>
<label>
取件时间
<input type="datetime-local" id="pickupTimeStartSearch" style="width: 190px;" class="form-control " placeholder="开始" aria-controls="tableId">
</label>
-
<label>
<input type="datetime-local" id="pickupTimeEndSearch" style="width: 190px;" class="form-control" placeholder="结束" aria-controls="tableId">
</label>
<button onclick="search()" type="button" class="btn btn-primary">查询</button>
<br/>
<button onclick="add()" type="button" class="btn btn-success 新增">添加</button>
<button onclick="graph()" type="button" class="btn btn-success 报表">报表</button>
<button onclick="deleteMore()" type="button" class="btn btn-danger 删除">批量删除</button>
</div>
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >快递名称</th>
<th >用户名称</th>
<th >站点名称</th>
<th >站点地址</th>
<th >快递大小</th>
<th >手机号</th>
<th >取件码</th>
<th >快递状态</th>
<th >取件时间</th>
<th>操作</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
<div class="col-md-6 col-sm-3">
<div class="dataTables_length" id="tableId_length">
<select name="tableId_length" aria-controls="tableId" id="selectPageSize"
onchange="changePageSize()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
条 每页
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item" id="tableId_previous" onclick="pageNumChange('pre')">
<a class="page-link" href="#" tabindex="-1">上一页</a>
</li>
<li class="page-item" id="tableId_next" onclick="pageNumChange('next')">
<a class="page-link" href="#">下一页</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "daiqu";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
var sexTypesOptions = [];
var kddxTypesOptions = [];
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
//用户名称
var nameSearchInput = $('#nameSearch');
if( nameSearchInput != null){
if (nameSearchInput.val() != null && nameSearchInput.val() != '') {
searchForm.name = $('#nameSearch').val();
}
}
var sexTypesSelectSearchInput = document.getElementById("sexTypesSelectSearch");
if(sexTypesSelectSearchInput != null){
var sexTypesIndex = sexTypesSelectSearchInput.selectedIndex;
if( sexTypesIndex != 0){
searchForm.sexTypes = document.getElementById("sexTypesSelectSearch").options[sexTypesIndex].value;
}
}
//站点名称
var zdnameSearchInput = $('#zdnameSearch');
if( zdnameSearchInput != null){
if (zdnameSearchInput.val() != null && zdnameSearchInput.val() != '') {
searchForm.zdname = $('#zdnameSearch').val();
}
}
<!-- 本表的查询条件 -->
//快递名称
var dqnameSearchInput = $('#dqnameSearch');
if( dqnameSearchInput != null){
if (dqnameSearchInput.val() != null && dqnameSearchInput.val() != '') {
searchForm.dqname = $('#dqnameSearch').val();
}
}
//快递大小
var kddxTypesSelectSearchInput = document.getElementById("kddxTypesSelectSearch");
if(kddxTypesSelectSearchInput != null){
var kddxTypesIndex = kddxTypesSelectSearchInput.selectedIndex;
if( kddxTypesIndex != 0){
searchForm.kddxTypes= document.getElementById("kddxTypesSelectSearch").options[kddxTypesIndex].value;
}
}
var pickupTimeStartSearch = $('#pickupTimeStartSearch');
if( pickupTimeStartSearch != null){
if (pickupTimeStartSearch.val() != null && pickupTimeStartSearch.val() != '') {
searchForm.pickupTimeStart = $('#pickupTimeStartSearch').val();
}
}
var pickupTimeEndSearch = $('#pickupTimeEndSearch');
if( pickupTimeEndSearch != null){
if (pickupTimeEndSearch.val() != null && pickupTimeEndSearch.val() != '') {
searchForm.pickupTimeEnd = $('#pickupTimeEndSearch').val();
}
}
getDataList();
}
// 获取数据列表
function getDataList() {
http("daiqu/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
dqname: searchForm.dqname,
kddxTypes: searchForm.kddxTypes,
pickupTimeStart: searchForm.pickupTimeStart,
pickupTimeEnd: searchForm.pickupTimeEnd,
//级联表的
name: searchForm.name,
sexTypes: searchForm.sexTypes,
zdname: searchForm.zdname,
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//快递名称
var dqnameCell = document.createElement('td');
dqnameCell.innerHTML = item.dqname;
row.appendChild(dqnameCell);
//用户名称
var nameCell = document.createElement('td');
nameCell.innerHTML = item.name;
row.appendChild(nameCell);
//站点名称
var zdnameCell = document.createElement('td');
zdnameCell.innerHTML = item.zdname;
row.appendChild(zdnameCell);
//站点地址
var addressCell = document.createElement('td');
addressCell.innerHTML = item.address;
row.appendChild(addressCell);
//快递大小
var kddxTypesCell = document.createElement('td');
kddxTypesCell.innerHTML = item.kddxValue;
row.appendChild(kddxTypesCell);
//手机号
var dqphoneCell = document.createElement('td');
dqphoneCell.innerHTML = item.dqphone;
row.appendChild(dqphoneCell);
//取件码
var takecodeCell = document.createElement('td');
takecodeCell.innerHTML = item.takecode;
row.appendChild(takecodeCell);
//快递状态
var kdztTypesCell = document.createElement('td');
kdztTypesCell.innerHTML = item.kdztValue;
row.appendChild(kdztTypesCell);
//取件时间
var pickupTimeCell = document.createElement('td');
if(item.pickupTime != null){
pickupTimeCell.innerHTML = item.pickupTime;
}else{
pickupTimeCell.innerHTML = "暂无被取时间";
}
row.appendChild(pickupTimeCell);
//每行按钮
var btnGroup = document.createElement('td');
//修改按钮
var editBtn = document.createElement('button');
var editAttr = 'edit(' + item.id + ')';
editBtn.setAttribute("type", "button");
editBtn.setAttribute("class", "btn btn-warning btn-sm 修改");
editBtn.setAttribute("onclick", editAttr);
editBtn.innerHTML = "修改"
btnGroup.appendChild(editBtn)
//删除按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'remove(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 删除");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "删除"
btnGroup.appendChild(deleteBtn)
if(item.kdztValue == "待取"){
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "pickUp(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 取件");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "立即取件"
btnGroup.appendChild(detailBtn)
}
if(item.kdztValue == "待取"){
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "replaceExpress(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-success btn-sm 发布订单");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "发布代取订单"
btnGroup.appendChild(detailBtn)
}
row.appendChild(btnGroup)
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("daiqu/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
//取件
function pickUp(id) {
var mymessage = confirm("你确定要取这件快递吗?");
if (mymessage == true) {
paramArray = id;
httpJson("daiqu/pickUp", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('取件成功');
}
})
;
}
else {
alert("已取消操作");
}
}
//发布代取订单
function replaceExpress(id) {
var mymessage = confirm("你确定要对这件快递发起代取订单吗?");
if (mymessage == true) {
paramArray = id;
httpJson("daiqu/replaceExpress", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('请求发布成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("adddaiqu", "adddaiqu");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(id) {
window.sessionStorage.setItem("updateId", id);
window.location.href = "info.jsp";
}
//填充级联表搜索下拉框
function sexTypesSelectSearch() {
var sexTypesSelectSearch = document.getElementById('sexTypesSelectSearch');
if(sexTypesSelectSearch != null) {
sexTypesSelectSearch.add(new Option('-请选择-',''));
if (sexTypesOptions != null && sexTypesOptions.length > 0){
for (var i = 0; i < sexTypesOptions.length; i++) {
sexTypesSelectSearch.add(new Option(sexTypesOptions[i].indexName, sexTypesOptions[i].codeIndex));
}
}
}
}
//填充本表搜索下拉框
function kddxTypesSelectSearch() {
var kddxTypesSelectSearch = document.getElementById('kddxTypesSelectSearch');
if(kddxTypesSelectSearch != null) {
kddxTypesSelectSearch.add(new Option('-请选择-',''));
if (kddxTypesOptions != null && kddxTypesOptions.length > 0){
for (var i = 0; i < kddxTypesOptions.length; i++) {
kddxTypesSelectSearch.add(new Option(kddxTypesOptions[i].indexName,kddxTypesOptions[i].codeIndex));
}
}
}
}
//查询级联表搜索条件所有列表
function sexTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=sex_types", "GET", {}, (res) => {
if(res.code == 0){
sexTypesOptions = res.data.list;
}
});
}
//查询当前表搜索条件所有列表
function kddxTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=kddx_types", "GET", {}, (res) => {
if(res.code == 0){
kddxTypesOptions = res.data.list;
}
});
}
$(document).ready(function () {
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
sexTypesSelect();
//查询当前表的搜索下拉框
kddxTypesSelect();
getDataList();
//级联表的下拉框赋值
sexTypesSelectSearch();
//当前表的下拉框赋值
kddxTypesSelectSearch();
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,487 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap-select.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">编辑</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表的字段 -->
<!-- 当前表的字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
placeholder="用户名称">
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
placeholder="账号">
</div>
<div class="form-group col-md-6">
<label>性别</label>
<select id="sexTypesSelect" name="sexTypes" class="form-control">
</select>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" src="" width="100" height="100">
<input name="file" type="file" id="imgPhotoupload"
class="form-control-file">
<input name="imgPhoto" id="imgPhoto-input" type="hidden">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
onchange="phoneChickValue(this)" placeholder="联系电话">
</div>
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">提交</button>
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js">
</script><script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap-select.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "daiquren";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
// 下拉框数组
<!-- 当前表的下拉框数组 -->
var sexTypesOptions = [];
<!-- 级联表的下拉框数组 -->
var ruleForm = {};
// 文件上传
function upload() {
<!-- 当前表的文件上传 -->
$('#imgPhotoupload').fileupload({
url: baseUrl + 'file/upload',
headers: {token: window.sessionStorage.getItem("token")},
dataType: 'json',
done: function (e, data) {
var photoUrl= baseUrl + 'file/download?fileName=' + data.result.file;
document.getElementById('imgPhotoImg').setAttribute('src',photoUrl);
document.getElementById('imgPhoto-input').setAttribute('value',photoUrl);
}
});
}
// 表单提交
function submit() {
if (validform() == true && compare() == true) {
let data = {};
getContent();
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
var urlParam;
var successMes = '';
if (updateId != null && updateId != "null" && updateId != '') {
urlParam = 'update';
successMes = '修改成功';
} else {
urlParam = 'save';
successMes = '添加成功';
}
httpJson("daiquren/" + urlParam, "POST", data, (res) => {
if(res.code == 0)
{
window.sessionStorage.removeItem('adddaiquren');
window.sessionStorage.removeItem('updateId');
let flag = true;
if (flag) {
alert(successMes);
}
if (window.sessionStorage.getItem('onlyme') != null && window.sessionStorage.getItem('onlyme') == "true") {
window.sessionStorage.removeItem('onlyme');
window.sessionStorage.setItem("reload","reload");
window.parent.location.href = "${pageContext.request.contextPath}/index.jsp";
} else {
window.location.href = "list.jsp";
}
}
});
} else {
alert("表单未填完整或有错误");
}
}
// 查询列表
<!-- 查询当前表的所有列表 -->
function sexTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=sex_types", "GET", {}, (res) => {
if(res.code == 0){
sexTypesOptions = res.data.list;
}
});
}
<!-- 查询级联表的所有列表 -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
function initializationSextypesSelect(){
var sexTypesSelect = document.getElementById('sexTypesSelect');
if(sexTypesSelect != null && sexTypesOptions != null && sexTypesOptions.length > 0 ){
for (var i = 0; i < sexTypesOptions.length; i++) {
sexTypesSelect.add(new Option(sexTypesOptions[i].indexName,sexTypesOptions[i].codeIndex));
}
}
}
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
// 下拉框选项回显
function setSelectOption() {
<!-- 当前表的下拉框回显 -->
var sexTypesSelect = document.getElementById("sexTypesSelect");
if(sexTypesSelect != null && sexTypesOptions != null && sexTypesOptions.length > 0 ) {
for (var i = 0; i < sexTypesOptions.length; i++) {
if (sexTypesOptions[i].codeIndex == ruleForm.sexTypes) {//下拉框value对比,如果一致就赋值汉字
sexTypesSelect.options[i].selected = true;
}
}
}
<!-- 级联表的下拉框回显 -->
}
// 填充富文本框
function setContent() {
<!-- 当前表的填充富文本框 -->
}
// 获取富文本框内容
function getContent() {
<!-- 获取当前表的富文本框内容 -->
}
//数字检查
<!-- 当前表的数字检查 -->
function phoneChickValue(e){
var this_val = e.value || 0;
var reg=/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if(!reg.test(this_val)){
e.value = "";
alert("手机号不正确");
return false;
}
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('adddaiquren');
window.location.href = "list.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
name: "required",
username: "required",
password: "required",
sexTypes: "required",
imgPhoto: "required",
phone: "required",
role: "required",
},
messages: {
name: "用户名称不能为空",
username: "账号不能为空",
password: "密码不能为空",
sexTypes: "性别不能为空",
imgPhoto: "头像不能为空",
phone: "联系电话不能为空",
role: "身份不能为空",
}
}).form();
}
// 获取当前详情
function getDetails() {
var adddaiquren = window.sessionStorage.getItem("adddaiquren");
if (adddaiquren != null && adddaiquren != "" && adddaiquren != "null") {
window.sessionStorage.removeItem('adddaiquren');
//注册表单验证
$(validform());
$('#submitBtn').text('新增');
} else {
$('#submitBtn').text('修改');
var userId = window.sessionStorage.getItem('userId');
updateId = userId;//先赋值登录用户id
var uId = window.sessionStorage.getItem('updateId');//获取修改传过来的id
if (uId != null && uId != "" && uId != "null") {
//如果修改id不为空就赋值修改id
updateId = uId;
}
window.sessionStorage.removeItem('updateId');
http("daiquren/info/" + updateId, "GET", {}, (res) => {
if(res.code == 0)
{
ruleForm = res.data
// 是/否下拉框回显
setSelectOption();
// 设置图片src
showImg();
// 数据填充
dataBind();
// 富文本框回显
setContent();
//注册表单验证
$(validform());
}
});
}
}
// 清除可能会重复渲染的selection
function clear(className) {
var elements = document.getElementsByClassName(className);
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
function dateTimePick() {
}
function dataBind() {
<!-- 级联表的数据回显 -->
<!-- 当前表的数据回显 -->
$("#updateId").val(ruleForm.id);
$("#name").val(ruleForm.name);
$("#username").val(ruleForm.username);
$("#password").val(ruleForm.password);
$("#phone").val(ruleForm.phone);
$("#role").val(ruleForm.role);
}
<!-- 级联表的数据回显 -->
//图片显示
function showImg() {
<!-- 当前表的图片 -->
$("#imgPhotoImg").attr("src",ruleForm.imgPhoto);
<!-- 级联表的图片 -->
}
<!-- 级联表的图片 -->
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
//设置导航栏菜单
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
//初始化时间插件
dateTimePick();
//查询所有下拉框
<!-- 当前表的下拉框 -->
sexTypesSelect();
<!-- 查询级联表的下拉框(用id做option,用名字及其他参数做名字级联修改) -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
initializationSextypesSelect();
<!-- 初始化级联表的下拉框 -->
$(".selectpicker" ).selectpicker('refresh');
getDetails();
//初始化上传按钮
upload();
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
readonly();
});
function readonly() {
if (window.sessionStorage.getItem('role') != '管理员') {
$('#jifen').attr('readonly', 'readonly');
//$('#money').attr('readonly', 'readonly');
}
}
//比较大小
function compare() {
var largerVal = null;
var smallerVal = null;
if (largerVal != null && smallerVal != null) {
if (largerVal <= smallerVal) {
alert(smallerName + '不能大于等于' + largerName);
return false;
}
}
return true;
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,245 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" id="navUl">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">登记</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表所有字段 -->
<!-- 本表所有字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
v-model="ruleForm.name" readonly>
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
v-model="ruleForm.username" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
v-model="ruleForm.sexValue" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
v-model="ruleForm.phone" readonly>
</div>
<div class="form-group col-md-6">
<label>身份</label>
<input id="role" name="role" class="form-control"
v-model="ruleForm.role" readonly>
</div>
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "daiquren";
var pageType = "add-or-update";
var updateId = "";
var sexTypesOptions = [];
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "daiquren/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
ruleForm = res.data;
showImg();
setContent();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 填充富文本框
function setContent() {
}
//图片显示
function showImg() {
$("#imgPhotoImg").attr("src", ruleForm.imgPhoto);
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('adddaiquren');
window.location.href = "list.jsp";
}
// 下载
function download(fileName) {
var url = baseUrl+'file/download?fileName='+fileName;
window.open(url);
}
//设置下载
function setDownloadBtn() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,607 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">列表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">列表</h3>
<div class="table-responsive mb-3">
<div class="col-sm-12">
<label>
用户名称
<input type="text" id="nameSearch" style="width: 140px;" class="form-control form-control-sm"
placeholder="用户名称" aria-controls="tableId">
</label>
<label>
性别
<select name="sexTypesSelectSearch" style="width: 100px;" id="sexTypesSelectSearch" class="form-control form-control-sm"
aria-controls="tableId">
</select>
</label>
<button onclick="search()" type="button" class="btn btn-primary">查询</button>
<br/>
<button onclick="add()" type="button" class="btn btn-success 新增">添加</button>
<button onclick="graph()" type="button" class="btn btn-success 报表">报表</button>
<button onclick="deleteMore()" type="button" class="btn btn-danger 删除">批量删除</button>
</div>
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >用户名称</th>
<th >账号</th>
<th >性别</th>
<th >头像</th>
<th >联系电话</th>
<th >身份</th>
<th>操作</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
<div class="col-md-6 col-sm-3">
<div class="dataTables_length" id="tableId_length">
<select name="tableId_length" aria-controls="tableId" id="selectPageSize"
onchange="changePageSize()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
条 每页
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item" id="tableId_previous" onclick="pageNumChange('pre')">
<a class="page-link" href="#" tabindex="-1">上一页</a>
</li>
<li class="page-item" id="tableId_next" onclick="pageNumChange('next')">
<a class="page-link" href="#">下一页</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "daiquren";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
var sexTypesOptions = [];
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
<!-- 本表的查询条件 -->
//用户名称
var nameSearchInput = $('#nameSearch');
if( nameSearchInput != null){
if (nameSearchInput.val() != null && nameSearchInput.val() != '') {
searchForm.name = $('#nameSearch').val();
}
}
//性别
var sexTypesSelectSearchInput = document.getElementById("sexTypesSelectSearch");
if(sexTypesSelectSearchInput != null){
var sexTypesIndex = sexTypesSelectSearchInput.selectedIndex;
if( sexTypesIndex != 0){
searchForm.sexTypes= document.getElementById("sexTypesSelectSearch").options[sexTypesIndex].value;
}
}
getDataList();
}
// 获取数据列表
function getDataList() {
http("daiquren/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
name: searchForm.name,
sexTypes: searchForm.sexTypes,
//级联表的
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//用户名称
var nameCell = document.createElement('td');
nameCell.innerHTML = item.name;
row.appendChild(nameCell);
//账号
var usernameCell = document.createElement('td');
usernameCell.innerHTML = item.username;
row.appendChild(usernameCell);
//性别
var sexTypesCell = document.createElement('td');
sexTypesCell.innerHTML = item.sexValue;
row.appendChild(sexTypesCell);
//头像
var imgPhotoCell = document.createElement('td');
var imgPhotoImg = document.createElement('img');
var imgPhotoImgValue = item.imgPhoto;
if(imgPhotoImgValue !=null && imgPhotoImgValue !='' && imgPhotoImgValue !='null'){
imgPhotoImg.setAttribute('src', imgPhotoImgValue);
imgPhotoImg.setAttribute('height', 100);
imgPhotoImg.setAttribute('width', 100);
imgPhotoCell.appendChild(imgPhotoImg);
}else{
imgPhotoCell.innerHTML = "暂无图片";
}
row.appendChild(imgPhotoCell);
//联系电话
var phoneCell = document.createElement('td');
phoneCell.innerHTML = item.phone;
row.appendChild(phoneCell);
//身份
var roleCell = document.createElement('td');
roleCell.innerHTML = item.role;
row.appendChild(roleCell);
//每行按钮
var btnGroup = document.createElement('td');
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "detail(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 查看");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "查看"
btnGroup.appendChild(detailBtn)
//修改按钮
var editBtn = document.createElement('button');
var editAttr = 'edit(' + item.id + ')';
editBtn.setAttribute("type", "button");
editBtn.setAttribute("class", "btn btn-warning btn-sm 修改");
editBtn.setAttribute("onclick", editAttr);
editBtn.innerHTML = "修改"
btnGroup.appendChild(editBtn)
//删除按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'remove(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 删除");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "删除"
btnGroup.appendChild(deleteBtn)
row.appendChild(btnGroup)
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("daiquren/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("adddaiquren", "adddaiquren");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(id) {
window.sessionStorage.setItem("updateId", id);
window.location.href = "info.jsp";
}
//填充级联表搜索下拉框
//填充本表搜索下拉框
function sexTypesSelectSearch() {
var sexTypesSelectSearch = document.getElementById('sexTypesSelectSearch');
if(sexTypesSelectSearch != null) {
sexTypesSelectSearch.add(new Option('-请选择-',''));
if (sexTypesOptions != null && sexTypesOptions.length > 0){
for (var i = 0; i < sexTypesOptions.length; i++) {
sexTypesSelectSearch.add(new Option(sexTypesOptions[i].indexName,sexTypesOptions[i].codeIndex));
}
}
}
}
//查询级联表搜索条件所有列表
//查询当前表搜索条件所有列表
function sexTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=sex_types", "GET", {}, (res) => {
if(res.code == 0){
sexTypesOptions = res.data.list;
}
});
}
$(document).ready(function () {
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
//查询当前表的搜索下拉框
sexTypesSelect();
getDataList();
//级联表的下拉框赋值
//当前表的下拉框赋值
sexTypesSelectSearch();
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,449 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap-select.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑字典表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">字典表管理</li>
<li class="breadcrumb-item active">编辑字典表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">字典表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表的字段 -->
<!-- 当前表的字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>字段</label>
<input id="dicCode" name="dicCode" class="form-control"
placeholder="字段">
</div>
<div class="form-group col-md-6">
<label>字段名</label>
<input id="dicName" name="dicName" class="form-control"
placeholder="字段名">
</div>
<div class="form-group col-md-6">
<label>编码</label>
<input id="codeIndex" name="codeIndex" class="form-control"
onchange="codeIndexChickValue(this)" placeholder="编码">
</div>
<div class="form-group col-md-6">
<label>编码名字</label>
<input id="indexName" name="indexName" class="form-control"
placeholder="编码名字">
</div>
<input id="superId" name="superId" type="hidden">
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">提交</button>
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js">
</script><script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap-select.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "dictionary";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
// 下拉框数组
<!-- 当前表的下拉框数组 -->
<!-- 级联表的下拉框数组 -->
var ruleForm = {};
// 文件上传
function upload() {
<!-- 当前表的文件上传 -->
}
// 表单提交
function submit() {
if (validform() == true && compare() == true) {
let data = {};
getContent();
if($("#superId") !=null){
var superId = $("#superId").val();
if(superId == null || superId =='' || superId == 'null'){
alert("父字段id不能为空");
return;
}
}
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
var urlParam;
var successMes = '';
if (updateId != null && updateId != "null" && updateId != '') {
urlParam = 'update';
successMes = '修改成功';
} else {
urlParam = 'save';
successMes = '添加成功';
}
httpJson("dictionary/" + urlParam, "POST", data, (res) => {
if(res.code == 0)
{
window.sessionStorage.removeItem('adddictionary');
window.sessionStorage.removeItem('updateId');
let flag = true;
if (flag) {
alert(successMes);
}
if (window.sessionStorage.getItem('onlyme') != null && window.sessionStorage.getItem('onlyme') == "true") {
window.sessionStorage.removeItem('onlyme');
window.sessionStorage.setItem("reload","reload");
window.parent.location.href = "${pageContext.request.contextPath}/index.jsp";
} else {
window.location.href = "list.jsp";
}
}
});
} else {
alert("表单未填完整或有错误");
}
}
// 查询列表
<!-- 查询当前表的所有列表 -->
<!-- 查询级联表的所有列表 -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
// 下拉框选项回显
function setSelectOption() {
<!-- 当前表的下拉框回显 -->
<!-- 级联表的下拉框回显 -->
}
// 填充富文本框
function setContent() {
<!-- 当前表的填充富文本框 -->
}
// 获取富文本框内容
function getContent() {
<!-- 获取当前表的富文本框内容 -->
}
//数字检查
<!-- 当前表的数字检查 -->
function codeIndexChickValue(e){
var this_val = e.value || 0;
/*if(this_val == 0){
e.value = "";
alert("0不允许输入");
return false;
}*/
var reg=/^[0-9]*$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('adddictionary');
window.location.href = "list.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
dicCode: "required",
dicName: "required",
codeIndex: "required",
indexName: "required",
superId: "required",
},
messages: {
dicCode: "字段不能为空",
dicName: "字段名不能为空",
codeIndex: "编码不能为空",
indexName: "编码名字不能为空",
superId: "父字段id不能为空",
}
}).form();
}
// 获取当前详情
function getDetails() {
var adddictionary = window.sessionStorage.getItem("adddictionary");
if (adddictionary != null && adddictionary != "" && adddictionary != "null") {
window.sessionStorage.removeItem('adddictionary');
//注册表单验证
$(validform());
$('#submitBtn').text('新增');
} else {
$('#submitBtn').text('修改');
var userId = window.sessionStorage.getItem('userId');
updateId = userId;//先赋值登录用户id
var uId = window.sessionStorage.getItem('updateId');//获取修改传过来的id
if (uId != null && uId != "" && uId != "null") {
//如果修改id不为空就赋值修改id
updateId = uId;
}
window.sessionStorage.removeItem('updateId');
http("dictionary/info/" + updateId, "GET", {}, (res) => {
if(res.code == 0)
{
ruleForm = res.data
// 是/否下拉框回显
setSelectOption();
// 设置图片src
showImg();
// 数据填充
dataBind();
// 富文本框回显
setContent();
//注册表单验证
$(validform());
}
});
}
}
// 清除可能会重复渲染的selection
function clear(className) {
var elements = document.getElementsByClassName(className);
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
function dateTimePick() {
}
function dataBind() {
<!-- 级联表的数据回显 -->
<!-- 当前表的数据回显 -->
$("#updateId").val(ruleForm.id);
$("#dicCode").val(ruleForm.dicCode);
$("#dicName").val(ruleForm.dicName);
$("#codeIndex").val(ruleForm.codeIndex);
$("#indexName").val(ruleForm.indexName);
$("#superId").val(ruleForm.superId);
}
<!-- 级联表的数据回显 -->
//图片显示
function showImg() {
<!-- 当前表的图片 -->
<!-- 级联表的图片 -->
}
<!-- 级联表的图片 -->
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
//设置导航栏菜单
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
//初始化时间插件
dateTimePick();
//查询所有下拉框
<!-- 当前表的下拉框 -->
<!-- 查询级联表的下拉框(用id做option,用名字及其他参数做名字级联修改) -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
<!-- 初始化级联表的下拉框 -->
$(".selectpicker" ).selectpicker('refresh');
getDetails();
//初始化上传按钮
upload();
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
readonly();
});
function readonly() {
if (window.sessionStorage.getItem('role') != '管理员') {
$('#jifen').attr('readonly', 'readonly');
//$('#money').attr('readonly', 'readonly');
}
}
//比较大小
function compare() {
var largerVal = null;
var smallerVal = null;
if (largerVal != null && smallerVal != null) {
if (largerVal <= smallerVal) {
alert(smallerName + '不能大于等于' + largerName);
return false;
}
}
return true;
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,233 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" id="navUl">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑字典表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">字典表管理</li>
<li class="breadcrumb-item active">字典表登记</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">字典表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表所有字段 -->
<!-- 本表所有字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>字段</label>
<input id="dicCode" name="dicCode" class="form-control"
v-model="ruleForm.dicCode" readonly>
</div>
<div class="form-group col-md-6">
<label>字段名</label>
<input id="dicName" name="dicName" class="form-control"
v-model="ruleForm.dicName" readonly>
</div>
<div class="form-group col-md-6">
<label>编码</label>
<input id="codeIndex" name="codeIndex" class="form-control"
v-model="ruleForm.codeIndex" readonly>
</div>
<div class="form-group col-md-6">
<label>编码名字</label>
<input id="indexName" name="indexName" class="form-control"
v-model="ruleForm.indexName" readonly>
</div>
<input id="superId" name="superId" v-model="ruleForm.superId" readonly type="hidden">
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "dictionary";
var pageType = "add-or-update";
var updateId = "";
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "dictionary/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
ruleForm = res.data;
showImg();
setContent();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 填充富文本框
function setContent() {
}
//图片显示
function showImg() {
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('adddictionary');
window.location.href = "list.jsp";
}
// 下载
function download(fileName) {
var url = baseUrl+'file/download?fileName='+fileName;
window.open(url);
}
//设置下载
function setDownloadBtn() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,527 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">字典表管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">字典表管理</li>
<li class="breadcrumb-item active">字典表列表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">字典表列表</h3>
<div class="table-responsive mb-3">
<div class="col-sm-12">
<button onclick="search()" type="button" class="btn btn-primary">查询</button>
<br/>
<button onclick="add()" type="button" class="btn btn-success 新增">添加</button>
<button onclick="graph()" type="button" class="btn btn-success 报表">报表</button>
<button onclick="deleteMore()" type="button" class="btn btn-danger 删除">批量删除</button>
</div>
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >字段</th>
<th >字段名</th>
<th >编码</th>
<th >编码名字</th>
<th>操作</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
<div class="col-md-6 col-sm-3">
<div class="dataTables_length" id="tableId_length">
<select name="tableId_length" aria-controls="tableId" id="selectPageSize"
onchange="changePageSize()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
条 每页
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item" id="tableId_previous" onclick="pageNumChange('pre')">
<a class="page-link" href="#" tabindex="-1">上一页</a>
</li>
<li class="page-item" id="tableId_next" onclick="pageNumChange('next')">
<a class="page-link" href="#">下一页</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "dictionary";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
<!-- 本表的查询条件 -->
getDataList();
}
// 获取数据列表
function getDataList() {
http("dictionary/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
//级联表的
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//字段
var dicCodeCell = document.createElement('td');
dicCodeCell.innerHTML = item.dicCode;
row.appendChild(dicCodeCell);
//字段名
var dicNameCell = document.createElement('td');
dicNameCell.innerHTML = item.dicName;
row.appendChild(dicNameCell);
//编码
var codeIndexCell = document.createElement('td');
codeIndexCell.innerHTML = item.codeIndex;
row.appendChild(codeIndexCell);
//编码名字
var indexNameCell = document.createElement('td');
indexNameCell.innerHTML = item.indexName;
row.appendChild(indexNameCell);
//每行按钮
var btnGroup = document.createElement('td');
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "detail(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 查看");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "查看"
btnGroup.appendChild(detailBtn)
//修改按钮
var editBtn = document.createElement('button');
var editAttr = 'edit(' + item.id + ')';
editBtn.setAttribute("type", "button");
editBtn.setAttribute("class", "btn btn-warning btn-sm 修改");
editBtn.setAttribute("onclick", editAttr);
editBtn.innerHTML = "修改"
btnGroup.appendChild(editBtn)
//删除按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'remove(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 删除");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "删除"
btnGroup.appendChild(deleteBtn)
row.appendChild(btnGroup)
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("dictionary/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("adddictionary", "adddictionary");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(id) {
window.sessionStorage.setItem("updateId", id);
window.location.href = "info.jsp";
}
//填充级联表搜索下拉框
//填充本表搜索下拉框
//查询级联表搜索条件所有列表
//查询当前表搜索条件所有列表
$(document).ready(function () {
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
//查询当前表的搜索下拉框
getDataList();
//级联表的下拉框赋值
//当前表的下拉框赋值
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,263 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">编辑</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container" style="width: 500px">
<div class="row" center>
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">忘记密码</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-12">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
placeholder="用户名称">
</div>
<div class="form-group col-md-12">
<label>账号</label>
<input id="account" name="account" class="form-control"
placeholder="账号">
</div>
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">取消</button>
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">找回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "yonghu";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
var sbTypesOptions = [];
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "yonghu/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 表单提交
function submit() {
if (validform() == true) {
let data = {};
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
httpJson("yonghu/resetPass", "POST", data, (res) => {
if(res.code == 0){
alert("您的密码已经修改为123456");
window.parent.location.href = "../../login.jsp";
}
})
;
} else {
alert("表单未填完整或有错误");
}
}
//搜素输入检查
function idChickValue(e){
var this_val = e.value || 0;
var reg=/^[0-9]*$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function balanceChickValue(e){
var this_val = e.value || 0;
var reg=/^[0-9]+.?[0-9]{1,2}$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function creditChickValue(e){
var this_val = e.value || 0;
var reg=/^[0-9]*$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function exit() {
window.location.href = "../../login.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
name: "required",
account: "required",
password: "required",
password2: "required",
},
messages: {
name: "用户名不能为空",
account: "账号不能为空",
password: "密码不能为空",
password2: "确认密码不能为空",
}
}).form();
}
$(document).ready(function () {
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
});
</script>
</body>
</html>

@ -0,0 +1,25 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>主页</title>
</head>
<body>
<div style="width: 100%;height: 720px">
<h1 align="center" style="margin-top: 250px;">
<strong></strong>
</h1>
</div>
<script src="${pageContext.request.contextPath}/resources/xznstatic/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/jsp/static/iframeAuto.js"></script>
<script>
<%@ include file = "../../utils/baseUrl.jsp" %>
$('h1 strong').html('欢迎使用' + projectName)
</script>
</body>
</html>

@ -0,0 +1,506 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap-select.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑快递接单表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">快递接单表管理</li>
<li class="breadcrumb-item active">编辑快递接单表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">快递接单表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表的字段 -->
<!-- 当前表的字段 -->
<input id="updateId" name="id" type="hidden">
<input id="daiqukuaidiId" name="daiqukuaidiId" type="hidden">
<input id="jdyonghuId" name="jdyonghuId" type="hidden">
<div class="form-group col-md-6">
<label>收件人名称</label>
<input id="addresseename" name="addresseename" class="form-control"
placeholder="收件人名称">
</div>
<div class="form-group col-md-6">
<label>电话</label>
<input id="jdphone" name="jdphone" class="form-control"
placeholder="电话">
</div>
<div class="form-group col-md-6">
<label>地址</label>
<input id="jdaddressee" name="jdaddressee" class="form-control"
placeholder="地址">
</div>
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">提交</button>
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js">
</script><script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap-select.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "jiedan";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
// 下拉框数组
<!-- 当前表的下拉框数组 -->
var jdztTypesOptions = [];
var kdlxTypesOptions = [];
<!-- 级联表的下拉框数组 -->
var ruleForm = {};
// 文件上传
function upload() {
<!-- 当前表的文件上传 -->
}
// 表单提交
function submit() {
if (validform() == true && compare() == true) {
let data = {};
getContent();
if($("#daiqukuaidiId") !=null){
var daiqukuaidiId = $("#daiqukuaidiId").val();
if(daiqukuaidiId == null || daiqukuaidiId =='' || daiqukuaidiId == 'null'){
alert("快递名称不能为空");
return;
}
}
if($("#jdyonghuId") !=null){
var jdyonghuId = $("#jdyonghuId").val();
if(jdyonghuId == null || jdyonghuId =='' || jdyonghuId == 'null'){
alert("发布人不能为空");
return;
}
}
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
var urlParam;
var successMes = '';
if (updateId != null && updateId != "null" && updateId != '') {
urlParam = 'update';
successMes = '修改成功';
} else {
urlParam = 'save';
successMes = '添加成功';
}
httpJson("jiedan/" + urlParam, "POST", data, (res) => {
if(res.code == 0)
{
window.sessionStorage.removeItem('addjiedan');
window.sessionStorage.removeItem('updateId');
let flag = true;
if (flag) {
alert(successMes);
}
if (window.sessionStorage.getItem('onlyme') != null && window.sessionStorage.getItem('onlyme') == "true") {
window.sessionStorage.removeItem('onlyme');
window.sessionStorage.setItem("reload","reload");
window.parent.location.href = "${pageContext.request.contextPath}/index.jsp";
} else {
window.location.href = "list.jsp";
}
}
});
} else {
alert("表单未填完整或有错误");
}
}
// 查询列表
<!-- 查询当前表的所有列表 -->
function jdztTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=jdzt_types", "GET", {}, (res) => {
if(res.code == 0){
jdztTypesOptions = res.data.list;
}
});
}
function kdlxTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=kdlx_types", "GET", {}, (res) => {
if(res.code == 0){
kdlxTypesOptions = res.data.list;
}
});
}
<!-- 查询级联表的所有列表 -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
function initializationJdzttypesSelect(){
var jdztTypesSelect = document.getElementById('jdztTypesSelect');
if(jdztTypesSelect != null && jdztTypesOptions != null && jdztTypesOptions.length > 0 ){
for (var i = 0; i < jdztTypesOptions.length; i++) {
jdztTypesSelect.add(new Option(jdztTypesOptions[i].indexName,jdztTypesOptions[i].codeIndex));
}
}
}
function initializationKdlxtypesSelect(){
var kdlxTypesSelect = document.getElementById('kdlxTypesSelect');
if(kdlxTypesSelect != null && kdlxTypesOptions != null && kdlxTypesOptions.length > 0 ){
for (var i = 0; i < kdlxTypesOptions.length; i++) {
kdlxTypesSelect.add(new Option(kdlxTypesOptions[i].indexName,kdlxTypesOptions[i].codeIndex));
}
}
}
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
// 下拉框选项回显
function setSelectOption() {
<!-- 当前表的下拉框回显 -->
var jdztTypesSelect = document.getElementById("jdztTypesSelect");
if(jdztTypesSelect != null && jdztTypesOptions != null && jdztTypesOptions.length > 0 ) {
for (var i = 0; i < jdztTypesOptions.length; i++) {
if (jdztTypesOptions[i].codeIndex == ruleForm.jdztTypes) {//下拉框value对比,如果一致就赋值汉字
jdztTypesSelect.options[i].selected = true;
}
}
}
var kdlxTypesSelect = document.getElementById("kdlxTypesSelect");
if(kdlxTypesSelect != null && kdlxTypesOptions != null && kdlxTypesOptions.length > 0 ) {
for (var i = 0; i < kdlxTypesOptions.length; i++) {
if (kdlxTypesOptions[i].codeIndex == ruleForm.kdlxTypes) {//下拉框value对比,如果一致就赋值汉字
kdlxTypesSelect.options[i].selected = true;
}
}
}
<!-- 级联表的下拉框回显 -->
}
// 填充富文本框
function setContent() {
<!-- 当前表的填充富文本框 -->
}
// 获取富文本框内容
function getContent() {
<!-- 获取当前表的富文本框内容 -->
}
//数字检查
<!-- 当前表的数字检查 -->
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addjiedan');
window.location.href = "list.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
odd: "required",
daiqukuaidiId: "required",
jdyonghuId: "required",
initiateTime: "required",
addresseename: "required",
jdphone: "required",
jdaddressee: "required",
jdtakecode: "required",
jdztTypes: "required",
kdlxTypes: "required",
},
messages: {
odd: "单号不能为空",
daiqukuaidiId: "快递名称不能为空",
jdyonghuId: "发布人不能为空",
initiateTime: "发布时间不能为空",
addresseename: "收件人名称不能为空",
jdphone: "电话不能为空",
jdaddressee: "地址不能为空",
jdtakecode: "(取/寄)件码不能为空",
jdztTypes: "快递状态不能为空",
kdlxTypes: "快递类型不能为空",
}
}).form();
}
// 获取当前详情
function getDetails() {
var addjiedan = window.sessionStorage.getItem("addjiedan");
if (addjiedan != null && addjiedan != "" && addjiedan != "null") {
window.sessionStorage.removeItem('addjiedan');
//注册表单验证
$(validform());
$('#submitBtn').text('新增');
} else {
$('#submitBtn').text('修改');
var userId = window.sessionStorage.getItem('userId');
updateId = userId;//先赋值登录用户id
var uId = window.sessionStorage.getItem('updateId');//获取修改传过来的id
if (uId != null && uId != "" && uId != "null") {
//如果修改id不为空就赋值修改id
updateId = uId;
}
window.sessionStorage.removeItem('updateId');
http("jiedan/info/" + updateId, "GET", {}, (res) => {
if(res.code == 0)
{
ruleForm = res.data
// 是/否下拉框回显
setSelectOption();
// 设置图片src
showImg();
// 数据填充
dataBind();
// 富文本框回显
setContent();
//注册表单验证
$(validform());
}
});
}
}
// 清除可能会重复渲染的selection
function clear(className) {
var elements = document.getElementsByClassName(className);
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
function dateTimePick() {
}
function dataBind() {
<!-- 级联表的数据回显 -->
<!-- 当前表的数据回显 -->
$("#updateId").val(ruleForm.id);
$("#odd").val(ruleForm.odd);
$("#daiqukuaidiId").val(ruleForm.daiqukuaidiId);
$("#jdyonghuId").val(ruleForm.jdyonghuId);
$("#initiateTime-input").val(ruleForm.initiateTime);
$("#addresseename").val(ruleForm.addresseename);
$("#jdphone").val(ruleForm.jdphone);
$("#jdaddressee").val(ruleForm.jdaddressee);
$("#jdtakecode").val(ruleForm.jdtakecode);
}
<!-- 级联表的数据回显 -->
//图片显示
function showImg() {
<!-- 当前表的图片 -->
<!-- 级联表的图片 -->
}
<!-- 级联表的图片 -->
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
//设置导航栏菜单
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
//初始化时间插件
dateTimePick();
//查询所有下拉框
<!-- 当前表的下拉框 -->
jdztTypesSelect();
kdlxTypesSelect();
<!-- 查询级联表的下拉框(用id做option,用名字及其他参数做名字级联修改) -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
initializationJdzttypesSelect();
initializationKdlxtypesSelect();
<!-- 初始化级联表的下拉框 -->
$(".selectpicker" ).selectpicker('refresh');
getDetails();
//初始化上传按钮
upload();
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
readonly();
});
function readonly() {
if (window.sessionStorage.getItem('role') != '管理员') {
$('#jifen').attr('readonly', 'readonly');
//$('#money').attr('readonly', 'readonly');
}
}
//比较大小
function compare() {
var largerVal = null;
var smallerVal = null;
if (largerVal != null && smallerVal != null) {
if (largerVal <= smallerVal) {
alert(smallerName + '不能大于等于' + largerName);
return false;
}
}
return true;
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,264 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" id="navUl">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑快递接单表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">快递接单表管理</li>
<li class="breadcrumb-item active">快递接单表登记</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">快递接单表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表所有字段 -->
<!-- 本表所有字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>单号</label>
<input id="odd" name="odd" class="form-control"
v-model="ruleForm.odd" readonly>
</div>
<input id="daiqukuaidiId" name="daiqukuaidiId" v-model="ruleForm.daiqukuaidiId" readonly type="hidden">
<input id="jdyonghuId" name="jdyonghuId" v-model="ruleForm.jdyonghuId" readonly type="hidden">
<div class="form-group col-md-6">
<label>发布时间</label>
<input id="initiateTime" name="initiateTime" class="form-control"
v-model="ruleForm.initiateTime" readonly>
</div>
<div class="form-group col-md-6">
<label>收件人名称</label>
<input id="addresseename" name="addresseename" class="form-control"
v-model="ruleForm.addresseename" readonly>
</div>
<div class="form-group col-md-6">
<label>电话</label>
<input id="jdphone" name="jdphone" class="form-control"
v-model="ruleForm.jdphone" readonly>
</div>
<div class="form-group col-md-6">
<label>地址</label>
<input id="jdaddressee" name="jdaddressee" class="form-control"
v-model="ruleForm.jdaddressee" readonly>
</div>
<div class="form-group col-md-6">
<label>(取/寄)件码</label>
<input id="jdtakecode" name="jdtakecode" class="form-control"
v-model="ruleForm.jdtakecode" readonly>
</div>
<div class="form-group col-md-6">
<label>快递状态</label>
<input id="jdztValue" name="jdztValue" class="form-control"
v-model="ruleForm.jdztValue" readonly>
</div>
<div class="form-group col-md-6">
<label>快递类型</label>
<input id="kdlxValue" name="kdlxValue" class="form-control"
v-model="ruleForm.kdlxValue" readonly>
</div>
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "jiedan";
var pageType = "add-or-update";
var updateId = "";
var jdztTypesOptions = [];
var kdlxTypesOptions = [];
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "jiedan/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
ruleForm = res.data;
showImg();
setContent();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 填充富文本框
function setContent() {
}
//图片显示
function showImg() {
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addjiedan');
window.location.href = "list.jsp";
}
// 下载
function download(fileName) {
var url = baseUrl+'file/download?fileName='+fileName;
window.open(url);
}
//设置下载
function setDownloadBtn() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,823 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">快递接单表管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">快递接单表管理</li>
<li class="breadcrumb-item active">快递接单表列表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">快递接单表列表</h3>
<div class="table-responsive mb-3">
<div class="col-sm-12">
<label>
发布时间
<input type="datetime-local" id="initiateTimeStartSearch" style="width: 190px;" class="form-control " placeholder="开始" aria-controls="tableId">
</label>
-
<label>
<input type="datetime-local" id="initiateTimeEndSearch" style="width: 190px;" class="form-control" placeholder="结束" aria-controls="tableId">
</label>
<label>
快递状态
<select name="jdztTypesSelectSearch" style="width: 100px;" id="jdztTypesSelectSearch" class="form-control form-control-sm"
aria-controls="tableId">
</select>
</label>
<label>
快递类型
<select name="kdlxTypesSelectSearch" style="width: 100px;" id="kdlxTypesSelectSearch" class="form-control form-control-sm"
aria-controls="tableId">
</select>
</label>
<button onclick="search()" type="button" class="btn btn-primary">查询</button>
<br/>
<button type="button" data-target="#exampleModal" data-toggle="modal" class="btn btn-success 寄件">寄件</button>
<button onclick="graph()" type="button" class="btn btn-success 报表">报表</button>
<button onclick="deleteMore()" type="button" class="btn btn-danger 删除">批量删除</button>
</div>
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >单号</th>
<th >快递名</th>
<th >发布人</th>
<th >收件人</th>
<th >电话</th>
<th >地址</th>
<th >(取/寄)件码</th>
<th >快递状态</th>
<th >快递类型</th>
<th >发布时间</th>
<th>操作</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
<div class="col-md-6 col-sm-3">
<div class="dataTables_length" id="tableId_length">
<select name="tableId_length" aria-controls="tableId" id="selectPageSize"
onchange="changePageSize()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
条 每页
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item" id="tableId_previous" onclick="pageNumChange('pre')">
<a class="page-link" href="#" tabindex="-1">上一页</a>
</li>
<li class="page-item" id="tableId_next" onclick="pageNumChange('next')">
<a class="page-link" href="#">下一页</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">任务发布设置</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-sm-4" style="margin-top: 8px">
快递名称:
</div>
<div class="col-sm-8">
<input id="kdname" class="form-control"/>
</div>
</br>
</br>
<div class="col-sm-4" style="margin-top: 8px">
请选择收件人:
</div>
<div class="col-sm-8">
<select id="yhSelectSearch" class="form-control">
</select>
</div>
</br>
</br>
<div class="col-sm-4" style="margin-top: 8px">
请选择快递大小:
</div>
<div class="col-sm-8">
<select id="kddxSelectSearch" class="form-control">
</select>
</div>
</div>
</br>
<div class="row" id="div1"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
<button type="button" id="receive" class="btn btn-primary">发布</button>
</div>
</div>
</div>
</div>
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "jiedan";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
var jdztTypesOptions = [];
var kdlxTypesOptions = [];
var yonghuOptions = [];
var kddxOptions = [];
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
<!-- 本表的查询条件 -->
var initiateTimeStartSearch = $('#initiateTimeStartSearch');
if( initiateTimeStartSearch != null){
if (initiateTimeStartSearch.val() != null && initiateTimeStartSearch.val() != '') {
searchForm.initiateTimeStart = $('#initiateTimeStartSearch').val();
}
}
var initiateTimeEndSearch = $('#initiateTimeEndSearch');
if( initiateTimeEndSearch != null){
if (initiateTimeEndSearch.val() != null && initiateTimeEndSearch.val() != '') {
searchForm.initiateTimeEnd = $('#initiateTimeEndSearch').val();
}
}
//快递状态
var jdztTypesSelectSearchInput = document.getElementById("jdztTypesSelectSearch");
if(jdztTypesSelectSearchInput != null){
var jdztTypesIndex = jdztTypesSelectSearchInput.selectedIndex;
if( jdztTypesIndex != 0){
searchForm.jdztTypes= document.getElementById("jdztTypesSelectSearch").options[jdztTypesIndex].value;
}
}
//快递类型
var kdlxTypesSelectSearchInput = document.getElementById("kdlxTypesSelectSearch");
if(kdlxTypesSelectSearchInput != null){
var kdlxTypesIndex = kdlxTypesSelectSearchInput.selectedIndex;
if( kdlxTypesIndex != 0){
searchForm.kdlxTypes= document.getElementById("kdlxTypesSelectSearch").options[kdlxTypesIndex].value;
}
}
getDataList();
}
// 获取数据列表
function getDataList() {
http("jiedan/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
initiateTimeStart: searchForm.initiateTimeStart,
initiateTimeEnd: searchForm.initiateTimeEnd,
jdztTypes: searchForm.jdztTypes,
kdlxTypes: searchForm.kdlxTypes,
//级联表的
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//单号
var oddCell = document.createElement('td');
oddCell.innerHTML = item.odd;
row.appendChild(oddCell);
//快递名称
var daiqukuaidimcCell = document.createElement('td');
daiqukuaidimcCell.innerHTML = item.daiqukuaidimc;
row.appendChild(daiqukuaidimcCell);
//发布人
var daiqukuaidimcCell = document.createElement('td');
daiqukuaidimcCell.innerHTML = item.fbrname;
row.appendChild(daiqukuaidimcCell);
//收件人名称
var addresseenameCell = document.createElement('td');
addresseenameCell.innerHTML = item.addresseename;
row.appendChild(addresseenameCell);
//电话
var jdphoneCell = document.createElement('td');
jdphoneCell.innerHTML = item.jdphone;
row.appendChild(jdphoneCell);
//地址
var jdaddresseeCell = document.createElement('td');
jdaddresseeCell.innerHTML = item.jdaddressee;
row.appendChild(jdaddresseeCell);
//(取/寄)件码
var jdtakecodeCell = document.createElement('td');
jdtakecodeCell.innerHTML = item.jdtakecode;
row.appendChild(jdtakecodeCell);
//快递状态
var jdztTypesCell = document.createElement('td');
jdztTypesCell.innerHTML = item.jdztValue;
row.appendChild(jdztTypesCell);
//快递类型
var kdlxTypesCell = document.createElement('td');
kdlxTypesCell.innerHTML = item.kdlxValue;
row.appendChild(kdlxTypesCell);
//发布时间
var initiateTimeCell = document.createElement('td');
initiateTimeCell.innerHTML = item.initiateTime;
row.appendChild(initiateTimeCell);
//每行按钮
var btnGroup = document.createElement('td');
//修改按钮
var editBtn = document.createElement('button');
var editAttr = 'edit(' + item.id + ')';
editBtn.setAttribute("type", "button");
editBtn.setAttribute("class", "btn btn-warning btn-sm 修改");
editBtn.setAttribute("onclick", editAttr);
editBtn.innerHTML = "修改"
btnGroup.appendChild(editBtn)
//删除按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'remove(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 删除");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "删除"
btnGroup.appendChild(deleteBtn)
if(item.jdztValue == "未接"){
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "receiving(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 接单");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "接单"
btnGroup.appendChild(detailBtn)
}
row.appendChild(btnGroup)
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("jiedan/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 删除
function receiving(id) {
var mymessage = confirm("真的要接单吗?");
if (mymessage == true) {
paramArray = id;
httpJson("jiedan/receiving", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('接单成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 删除
function ship(yh,name,dx) {
var mymessage = confirm("真的要寄件吗?");
if (mymessage == true) {
httpJson("jiedan/ship?name="+name+"&yh="+yh+"&dx="+dx, "get", null, (res) => {
if(res.code == 0
)
{
getDataList();
alert('寄件请求发送成功');
$('#exampleModal').modal('hide')
$("#yhSelectSearch").attr("value",null);
$("#kdname").attr("value",null);
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("addjiedan", "addjiedan");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(id) {
window.sessionStorage.setItem("updateId", id);
window.location.href = "info.jsp";
}
//填充级联表搜索下拉框
//填充本表搜索下拉框
function jdztTypesSelectSearch() {
var jdztTypesSelectSearch = document.getElementById('jdztTypesSelectSearch');
if(jdztTypesSelectSearch != null) {
jdztTypesSelectSearch.add(new Option('-请选择-',''));
if (jdztTypesOptions != null && jdztTypesOptions.length > 0){
for (var i = 0; i < jdztTypesOptions.length; i++) {
jdztTypesSelectSearch.add(new Option(jdztTypesOptions[i].indexName,jdztTypesOptions[i].codeIndex));
}
}
}
}
function kdlxTypesSelectSearch() {
var kdlxTypesSelectSearch = document.getElementById('kdlxTypesSelectSearch');
if(kdlxTypesSelectSearch != null) {
kdlxTypesSelectSearch.add(new Option('-请选择-',''));
if (kdlxTypesOptions != null && kdlxTypesOptions.length > 0){
for (var i = 0; i < kdlxTypesOptions.length; i++) {
kdlxTypesSelectSearch.add(new Option(kdlxTypesOptions[i].indexName,kdlxTypesOptions[i].codeIndex));
}
}
}
}
function yonghuSelectSearch() {
var yhSelectSearch = document.getElementById('yhSelectSearch');
if(yhSelectSearch != null) {
yhSelectSearch.add(new Option('-请选择-',''));
if (yonghuOptions != null && yonghuOptions.length > 0){
for (var i = 0; i < yonghuOptions.length; i++) {
yhSelectSearch.add(new Option(yonghuOptions[i].name,yonghuOptions[i].id));
}
}
}
}
function kddxSelectSearch() {
var kddxSelectSearch = document.getElementById('kddxSelectSearch');
if(kddxSelectSearch != null) {
kddxSelectSearch.add(new Option('-请选择-',''));
if (kddxOptions != null && kddxOptions.length > 0){
for (var i = 0; i < kddxOptions.length; i++) {
kddxSelectSearch.add(new Option(kddxOptions[i].indexName,kddxOptions[i].codeIndex));
}
}
}
}
//查询级联表搜索条件所有列表
//查询当前表搜索条件所有列表
function jdztTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=jdzt_types", "GET", {}, (res) => {
if(res.code == 0){
jdztTypesOptions = res.data.list;
}
});
}
function kdlxTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=kdlx_types", "GET", {}, (res) => {
if(res.code == 0){
kdlxTypesOptions = res.data.list;
}
});
}
function yonghuSelect() {
//填充下拉框选项
http("yonghu/page?page=1&limit=100", "GET", {}, (res) => {
if(res.code == 0){
yonghuOptions = res.data.list;
}
});
}
function kddxSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=kddx_types", "GET", {}, (res) => {
if(res.code == 0){
kddxOptions = res.data.list;
}
});
}
$(document).ready(function () {
$('#receive').on('click', function (e) {
e.preventDefault();
var yh = $("#yhSelectSearch").val();
var dx = $("#kddxSelectSearch").val();
var name = $("#kdname").val();
ship(yh,name,dx);
});
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
//查询当前表的搜索下拉框
jdztTypesSelect();
kdlxTypesSelect();
yonghuSelect();
kddxSelect();
getDataList();
//级联表的下拉框赋值
//当前表的下拉框赋值
jdztTypesSelectSearch();
kddxSelectSearch();
yonghuSelectSearch();
kdlxTypesSelectSearch();
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,282 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">编辑</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container" style="width: 500px">
<div class="row" center>
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">注册</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-12">
<label>学号</label>
<input id="studentnumber" name="studentnumber" class="form-control"
placeholder="学号">
</div>
<div class="form-group col-md-12">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
placeholder="用户名称">
</div>
<div class="form-group col-md-12">
<label>账号</label>
<input id="username" name="username" class="form-control"
placeholder="账号">
</div>
<div class="form-group col-md-12">
<label>密码</label>
<input id="password" name="password" class="form-control"
placeholder="密码">
</div>
<div class="form-group col-md-12">
<label>确认密码</label>
<input id="password2" name="password2" class="form-control"
placeholder="确认密码">
<input id="yanzheng" name="yanzheng" type="hidden" value="0" class="form-control"
placeholder="确认密码">
</div>
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">注册</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "yonghu";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
var sbTypesOptions = [];
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "yonghu/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 表单提交
function submit() {
if (validform() == true) {
let data = {};
let value = $('#addOrUpdateForm').serializeArray();
if($("#password2").val() != $("#password").val()){
return alert("两次输入密码不一致")
}
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
httpJson("yonghu/save", "POST", data, (res) => {
if(res.code == 0){
alert("注册成功,请耐心等待管理验证");
window.parent.location.href = "../../login.jsp";
}
})
;
} else {
alert("表单未填完整或有错误");
}
}
//搜素输入检查
function idChickValue(e){
var this_val = e.value || 0;
var reg=/^[0-9]*$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function balanceChickValue(e){
var this_val = e.value || 0;
var reg=/^[0-9]+.?[0-9]{1,2}$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function creditChickValue(e){
var this_val = e.value || 0;
var reg=/^[0-9]*$/;
if(!reg.test(this_val)){
e.value = "";
alert("输入不合法");
return false;
}
}
function exit() {
window.location.href = "../../login.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
name: "required",
username: "required",
password: "required",
password2: "required",
},
messages: {
name: "用户名不能为空",
username: "账号不能为空",
password: "密码不能为空",
password2: "确认密码不能为空",
}
}).form();
}
$(document).ready(function () {
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
});
</script>
</body>
</html>

@ -0,0 +1,701 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap-select.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑已接单表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">已接单表管理</li>
<li class="breadcrumb-item active">编辑已接单表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">已接单表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表的字段 -->
<div class="form-group col-md-6">
<label></label>
<div>
<select id="daiqurenSelect" name="daiqurenSelect"
class="selectpicker form-control" data-live-search="true"
title="请选择" data-header="请选择" data-size="5">
</select>
</div>
</div>
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
placeholder="用户名称" readonly>
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
placeholder="账号" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
placeholder="性别" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" src="" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
placeholder="联系电话" readonly>
</div>
<div class="form-group col-md-6">
<label>身份</label>
<input id="role" name="role" class="form-control"
placeholder="身份" readonly>
</div>
<div class="form-group col-md-6">
<label></label>
<div>
<select id="yonghuSelect" name="yonghuSelect"
class="selectpicker form-control" data-live-search="true"
title="请选择" data-header="请选择" data-size="5">
</select>
</div>
</div>
<div class="form-group col-md-6">
<label>学号</label>
<input id="studentnumber" name="studentnumber" class="form-control"
placeholder="学号" readonly>
</div>
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
placeholder="用户名称" readonly>
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
placeholder="账号" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
placeholder="性别" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" src="" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
placeholder="联系电话" readonly>
</div>
<div class="form-group col-md-6">
<label>住宿楼栋</label>
<input id="zhuSuLou" name="zhuSuLou" class="form-control"
placeholder="住宿楼栋" readonly>
</div>
<div class="form-group col-md-6">
<label>寝室号</label>
<input id="dormitory" name="dormitory" class="form-control"
placeholder="寝室号" readonly>
</div>
<div class="form-group col-md-6">
<label>身份</label>
<input id="role" name="role" class="form-control"
placeholder="身份" readonly>
</div>
<!-- 当前表的字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>单号</label>
<input id="odd" name="odd" class="form-control"
placeholder="单号">
</div>
<input id="yonghuId" name="yonghuId" type="hidden">
<div class="form-group col-md-6">
<label>手机号</label>
<input id="fbphone" name="fbphone" class="form-control"
placeholder="手机号">
</div>
<input id="daiqurenId" name="daiqurenId" type="hidden">
<div class="form-group col-md-6">
<label>手机号</label>
<input id="jdphone" name="jdphone" class="form-control"
placeholder="手机号">
</div>
<div class="form-group col-md-6">
<label>接单时间</label>
<input id="initiateTime-input" name="initiateTime" size="20" type="month" class="form-control">
</div>
<div class="form-group col-md-6">
<label>订单状态</label>
<select id="ddztTypesSelect" name="ddztTypes" class="form-control">
</select>
</div>
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">提交</button>
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js">
</script><script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap-select.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "yijiedan";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
// 下拉框数组
<!-- 当前表的下拉框数组 -->
var ddztTypesOptions = [];
<!-- 级联表的下拉框数组 -->
var daiqurenOptions = [];
var yonghuOptions = [];
var ruleForm = {};
// 文件上传
function upload() {
<!-- 当前表的文件上传 -->
}
// 表单提交
function submit() {
if (validform() == true && compare() == true) {
let data = {};
getContent();
if($("#yonghuId") !=null){
var yonghuId = $("#yonghuId").val();
if(yonghuId == null || yonghuId =='' || yonghuId == 'null'){
alert("发布人不能为空");
return;
}
}
if($("#daiqurenId") !=null){
var daiqurenId = $("#daiqurenId").val();
if(daiqurenId == null || daiqurenId =='' || daiqurenId == 'null'){
alert("接单人不能为空");
return;
}
}
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
var urlParam;
var successMes = '';
if (updateId != null && updateId != "null" && updateId != '') {
urlParam = 'update';
successMes = '修改成功';
} else {
urlParam = 'save';
successMes = '添加成功';
}
httpJson("yijiedan/" + urlParam, "POST", data, (res) => {
if(res.code == 0)
{
window.sessionStorage.removeItem('addyijiedan');
window.sessionStorage.removeItem('updateId');
let flag = true;
if (flag) {
alert(successMes);
}
if (window.sessionStorage.getItem('onlyme') != null && window.sessionStorage.getItem('onlyme') == "true") {
window.sessionStorage.removeItem('onlyme');
window.sessionStorage.setItem("reload","reload");
window.parent.location.href = "${pageContext.request.contextPath}/index.jsp";
} else {
window.location.href = "list.jsp";
}
}
});
} else {
alert("表单未填完整或有错误");
}
}
// 查询列表
<!-- 查询当前表的所有列表 -->
function ddztTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=ddzt_types", "GET", {}, (res) => {
if(res.code == 0){
ddztTypesOptions = res.data.list;
}
});
}
<!-- 查询级联表的所有列表 -->
function daiqurenSelect() {
//填充下拉框选项
http("daiquren/page?page=1&limit=100&sort=&order=", "GET", {}, (res) => {
if(res.code == 0){
daiqurenOptions = res.data.list;
}
});
}
function daiqurenSelectOne(id) {
http("daiquren/info/"+id, "GET", {}, (res) => {
if(res.code == 0){
ruleForm = res.data;
daiqurenShowImg();
daiqurenDataBind();
}
});
}
function yonghuSelect() {
//填充下拉框选项
http("yonghu/page?page=1&limit=100&sort=&order=", "GET", {}, (res) => {
if(res.code == 0){
yonghuOptions = res.data.list;
}
});
}
function yonghuSelectOne(id) {
http("yonghu/info/"+id, "GET", {}, (res) => {
if(res.code == 0){
ruleForm = res.data;
yonghuShowImg();
yonghuDataBind();
}
});
}
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
function initializationDdzttypesSelect(){
var ddztTypesSelect = document.getElementById('ddztTypesSelect');
if(ddztTypesSelect != null && ddztTypesOptions != null && ddztTypesOptions.length > 0 ){
for (var i = 0; i < ddztTypesOptions.length; i++) {
ddztTypesSelect.add(new Option(ddztTypesOptions[i].indexName,ddztTypesOptions[i].codeIndex));
}
}
}
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
function initializationdaiqurenSelect() {
var daiqurenSelect = document.getElementById('daiqurenSelect');
if(daiqurenSelect != null && daiqurenOptions != null && daiqurenOptions.length > 0 ) {
for (var i = 0; i < daiqurenOptions.length; i++) {
daiqurenSelect.add(new Option(daiqurenOptions[i].name, daiqurenOptions[i].id));
}
$("#daiqurenSelect").change(function(e) {
daiqurenSelectOne(e.target.value);
});
}
}
function initializationyonghuSelect() {
var yonghuSelect = document.getElementById('yonghuSelect');
if(yonghuSelect != null && yonghuOptions != null && yonghuOptions.length > 0 ) {
for (var i = 0; i < yonghuOptions.length; i++) {
yonghuSelect.add(new Option(yonghuOptions[i].name, yonghuOptions[i].id));
}
$("#yonghuSelect").change(function(e) {
yonghuSelectOne(e.target.value);
});
}
}
// 下拉框选项回显
function setSelectOption() {
<!-- 当前表的下拉框回显 -->
var ddztTypesSelect = document.getElementById("ddztTypesSelect");
if(ddztTypesSelect != null && ddztTypesOptions != null && ddztTypesOptions.length > 0 ) {
for (var i = 0; i < ddztTypesOptions.length; i++) {
if (ddztTypesOptions[i].codeIndex == ruleForm.ddztTypes) {//下拉框value对比,如果一致就赋值汉字
ddztTypesSelect.options[i].selected = true;
}
}
}
<!-- 级联表的下拉框回显 -->
var daiqurenSelect = document.getElementById("daiqurenSelect");
if(daiqurenSelect != null && daiqurenOptions != null && daiqurenOptions.length > 0 ) {
for (var i = 0; i < daiqurenOptions.length; i++) {
if (daiqurenOptions[i].id == ruleForm.daiqurenId) {//下拉框value对比,如果一致就赋值汉字
daiqurenSelect.options[i+1].selected = true;
$("#daiqurenSelect" ).selectpicker('refresh');
}
}
}
var yonghuSelect = document.getElementById("yonghuSelect");
if(yonghuSelect != null && yonghuOptions != null && yonghuOptions.length > 0 ) {
for (var i = 0; i < yonghuOptions.length; i++) {
if (yonghuOptions[i].id == ruleForm.yonghuId) {//下拉框value对比,如果一致就赋值汉字
yonghuSelect.options[i+1].selected = true;
$("#yonghuSelect" ).selectpicker('refresh');
}
}
}
}
// 填充富文本框
function setContent() {
<!-- 当前表的填充富文本框 -->
}
// 获取富文本框内容
function getContent() {
<!-- 获取当前表的富文本框内容 -->
}
//数字检查
<!-- 当前表的数字检查 -->
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addyijiedan');
window.location.href = "list.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
odd: "required",
yonghuId: "required",
fbphone: "required",
daiqurenId: "required",
jdphone: "required",
initiateTime: "required",
ddztTypes: "required",
},
messages: {
odd: "单号不能为空",
yonghuId: "发布人不能为空",
fbphone: "手机号不能为空",
daiqurenId: "接单人不能为空",
jdphone: "手机号不能为空",
initiateTime: "接单时间不能为空",
ddztTypes: "订单状态不能为空",
}
}).form();
}
// 获取当前详情
function getDetails() {
var addyijiedan = window.sessionStorage.getItem("addyijiedan");
if (addyijiedan != null && addyijiedan != "" && addyijiedan != "null") {
window.sessionStorage.removeItem('addyijiedan');
//注册表单验证
$(validform());
$('#submitBtn').text('新增');
} else {
$('#submitBtn').text('修改');
var userId = window.sessionStorage.getItem('userId');
updateId = userId;//先赋值登录用户id
var uId = window.sessionStorage.getItem('updateId');//获取修改传过来的id
if (uId != null && uId != "" && uId != "null") {
//如果修改id不为空就赋值修改id
updateId = uId;
}
window.sessionStorage.removeItem('updateId');
http("yijiedan/info/" + updateId, "GET", {}, (res) => {
if(res.code == 0)
{
ruleForm = res.data
// 是/否下拉框回显
setSelectOption();
// 设置图片src
showImg();
// 数据填充
dataBind();
// 富文本框回显
setContent();
//注册表单验证
$(validform());
}
});
}
}
// 清除可能会重复渲染的selection
function clear(className) {
var elements = document.getElementsByClassName(className);
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
function dateTimePick() {
}
function dataBind() {
<!-- 级联表的数据回显 -->
daiqurenDataBind();
yonghuDataBind();
<!-- 当前表的数据回显 -->
$("#updateId").val(ruleForm.id);
$("#odd").val(ruleForm.odd);
$("#yonghuId").val(ruleForm.yonghuId);
$("#fbphone").val(ruleForm.fbphone);
$("#daiqurenId").val(ruleForm.daiqurenId);
$("#jdphone").val(ruleForm.jdphone);
$("#initiateTime-input").val(ruleForm.initiateTime);
}
<!-- 级联表的数据回显 -->
function daiqurenDataBind(){
<!-- 把id赋值给当前表的id-->
$("#daiqurenId").val(ruleForm.id);
$("#name").val(ruleForm.name);
$("#username").val(ruleForm.username);
$("#password").val(ruleForm.password);
$("#sexValue").val(ruleForm.sexValue);
$("#phone").val(ruleForm.phone);
$("#role").val(ruleForm.role);
}
function yonghuDataBind(){
<!-- 把id赋值给当前表的id-->
$("#yonghuId").val(ruleForm.id);
$("#studentnumber").val(ruleForm.studentnumber);
$("#name").val(ruleForm.name);
$("#username").val(ruleForm.username);
$("#password").val(ruleForm.password);
$("#sexValue").val(ruleForm.sexValue);
$("#phone").val(ruleForm.phone);
$("#zhuSuLou").val(ruleForm.zhuSuLou);
$("#dormitory").val(ruleForm.dormitory);
$("#role").val(ruleForm.role);
}
//图片显示
function showImg() {
<!-- 当前表的图片 -->
<!-- 级联表的图片 -->
daiqurenShowImg();
yonghuShowImg();
}
<!-- 级联表的图片 -->
function daiqurenShowImg() {
$("#imgPhotoImg").attr("src",ruleForm.imgPhoto);
}
function yonghuShowImg() {
$("#imgPhotoImg").attr("src",ruleForm.imgPhoto);
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
//设置导航栏菜单
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
//初始化时间插件
dateTimePick();
//查询所有下拉框
<!-- 当前表的下拉框 -->
ddztTypesSelect();
<!-- 查询级联表的下拉框(用id做option,用名字及其他参数做名字级联修改) -->
daiqurenSelect();
yonghuSelect();
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
initializationDdzttypesSelect();
<!-- 初始化级联表的下拉框 -->
initializationdaiqurenSelect();
initializationyonghuSelect();
$(".selectpicker" ).selectpicker('refresh');
getDetails();
//初始化上传按钮
upload();
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
readonly();
});
function readonly() {
if (window.sessionStorage.getItem('role') != '管理员') {
$('#jifen').attr('readonly', 'readonly');
//$('#money').attr('readonly', 'readonly');
}
}
//比较大小
function compare() {
var largerVal = null;
var smallerVal = null;
if (largerVal != null && smallerVal != null) {
if (largerVal <= smallerVal) {
alert(smallerName + '不能大于等于' + largerName);
return false;
}
}
return true;
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,347 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" id="navUl">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑已接单表</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">已接单表管理</li>
<li class="breadcrumb-item active">已接单表登记</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">已接单表信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表所有字段 -->
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
v-model="ruleForm.name" readonly>
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
v-model="ruleForm.username" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
v-model="ruleForm.sexValue" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
v-model="ruleForm.phone" readonly>
</div>
<div class="form-group col-md-6">
<label>身份</label>
<input id="role" name="role" class="form-control"
v-model="ruleForm.role" readonly>
</div>
<div class="form-group col-md-6">
<label>学号</label>
<input id="studentnumber" name="studentnumber" class="form-control"
v-model="ruleForm.studentnumber" readonly>
</div>
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
v-model="ruleForm.name" readonly>
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
v-model="ruleForm.username" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
v-model="ruleForm.sexValue" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
v-model="ruleForm.phone" readonly>
</div>
<div class="form-group col-md-6">
<label>住宿楼栋</label>
<input id="zhuSuLou" name="zhuSuLou" class="form-control"
v-model="ruleForm.zhuSuLou" readonly>
</div>
<div class="form-group col-md-6">
<label>寝室号</label>
<input id="dormitory" name="dormitory" class="form-control"
v-model="ruleForm.dormitory" readonly>
</div>
<div class="form-group col-md-6">
<label>身份</label>
<input id="role" name="role" class="form-control"
v-model="ruleForm.role" readonly>
</div>
<!-- 本表所有字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>单号</label>
<input id="odd" name="odd" class="form-control"
v-model="ruleForm.odd" readonly>
</div>
<input id="yonghuId" name="yonghuId" v-model="ruleForm.yonghuId" readonly type="hidden">
<div class="form-group col-md-6">
<label>手机号</label>
<input id="fbphone" name="fbphone" class="form-control"
v-model="ruleForm.fbphone" readonly>
</div>
<input id="daiqurenId" name="daiqurenId" v-model="ruleForm.daiqurenId" readonly type="hidden">
<div class="form-group col-md-6">
<label>手机号</label>
<input id="jdphone" name="jdphone" class="form-control"
v-model="ruleForm.jdphone" readonly>
</div>
<div class="form-group col-md-6">
<label>接单时间</label>
<input id="initiateTime" name="initiateTime" class="form-control"
v-model="ruleForm.initiateTime" readonly>
</div>
<div class="form-group col-md-6">
<label>订单状态</label>
<input id="ddztValue" name="ddztValue" class="form-control"
v-model="ruleForm.ddztValue" readonly>
</div>
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "yijiedan";
var pageType = "add-or-update";
var updateId = "";
var ddztTypesOptions = [];
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "yijiedan/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
ruleForm = res.data;
showImg();
setContent();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 填充富文本框
function setContent() {
}
//图片显示
function showImg() {
$("#imgPhotoImg").attr("src", ruleForm.imgPhoto);
$("#imgPhotoImg").attr("src", ruleForm.imgPhoto);
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addyijiedan');
window.location.href = "list.jsp";
}
// 下载
function download(fileName) {
var url = baseUrl+'file/download?fileName='+fileName;
window.open(url);
}
//设置下载
function setDownloadBtn() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,655 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">快递接单表管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">快递接单表管理</li>
<li class="breadcrumb-item active">快递接单详情信息</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">快递接单详情信息</h3>
<div class="table-responsive mb-3">
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >单号</th>
<th >快递名</th>
<th >发布人</th>
<th >收件人</th>
<th >电话</th>
<th >地址</th>
<th >(取/寄)件码</th>
<th >快递状态</th>
<th >快递类型</th>
<th >发布时间</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "jiedan";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
var jdztTypesOptions = [];
var kdlxTypesOptions = [];
var yonghuOptions = [];
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
<!-- 本表的查询条件 -->
var initiateTimeStartSearch = $('#initiateTimeStartSearch');
if( initiateTimeStartSearch != null){
if (initiateTimeStartSearch.val() != null && initiateTimeStartSearch.val() != '') {
searchForm.initiateTimeStart = $('#initiateTimeStartSearch').val();
}
}
var initiateTimeEndSearch = $('#initiateTimeEndSearch');
if( initiateTimeEndSearch != null){
if (initiateTimeEndSearch.val() != null && initiateTimeEndSearch.val() != '') {
searchForm.initiateTimeEnd = $('#initiateTimeEndSearch').val();
}
}
//快递状态
var jdztTypesSelectSearchInput = document.getElementById("jdztTypesSelectSearch");
if(jdztTypesSelectSearchInput != null){
var jdztTypesIndex = jdztTypesSelectSearchInput.selectedIndex;
if( jdztTypesIndex != 0){
searchForm.jdztTypes= document.getElementById("jdztTypesSelectSearch").options[jdztTypesIndex].value;
}
}
//快递类型
var kdlxTypesSelectSearchInput = document.getElementById("kdlxTypesSelectSearch");
if(kdlxTypesSelectSearchInput != null){
var kdlxTypesIndex = kdlxTypesSelectSearchInput.selectedIndex;
if( kdlxTypesIndex != 0){
searchForm.kdlxTypes= document.getElementById("kdlxTypesSelectSearch").options[kdlxTypesIndex].value;
}
}
getDataList();
}
// 获取数据列表
function getDataList() {
http("jiedan/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
odd: window.sessionStorage.getItem("odd"),
initiateTimeStart: searchForm.initiateTimeStart,
initiateTimeEnd: searchForm.initiateTimeEnd,
jdztTypes: searchForm.jdztTypes,
kdlxTypes: searchForm.kdlxTypes,
//级联表的
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//单号
var oddCell = document.createElement('td');
oddCell.innerHTML = item.odd;
row.appendChild(oddCell);
//快递名称
var daiqukuaidimcCell = document.createElement('td');
daiqukuaidimcCell.innerHTML = item.daiqukuaidimc;
row.appendChild(daiqukuaidimcCell);
//发布人
var daiqukuaidimcCell = document.createElement('td');
daiqukuaidimcCell.innerHTML = item.fbrname;
row.appendChild(daiqukuaidimcCell);
//收件人名称
var addresseenameCell = document.createElement('td');
addresseenameCell.innerHTML = item.addresseename;
row.appendChild(addresseenameCell);
//电话
var jdphoneCell = document.createElement('td');
jdphoneCell.innerHTML = item.jdphone;
row.appendChild(jdphoneCell);
//地址
var jdaddresseeCell = document.createElement('td');
jdaddresseeCell.innerHTML = item.jdaddressee;
row.appendChild(jdaddresseeCell);
//(取/寄)件码
var jdtakecodeCell = document.createElement('td');
jdtakecodeCell.innerHTML = item.jdtakecode;
row.appendChild(jdtakecodeCell);
//快递状态
var jdztTypesCell = document.createElement('td');
jdztTypesCell.innerHTML = item.jdztValue;
row.appendChild(jdztTypesCell);
//快递类型
var kdlxTypesCell = document.createElement('td');
kdlxTypesCell.innerHTML = item.kdlxValue;
row.appendChild(kdlxTypesCell);
//发布时间
var initiateTimeCell = document.createElement('td');
initiateTimeCell.innerHTML = item.initiateTime;
row.appendChild(initiateTimeCell);
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("jiedan/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 删除
function receiving(id) {
var mymessage = confirm("真的要接单吗?");
if (mymessage == true) {
paramArray = id;
httpJson("jiedan/receiving", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('接单成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 删除
function ship(yh,name) {
var mymessage = confirm("真的要寄件吗?");
if (mymessage == true) {
httpJson("jiedan/ship?name="+name+"&yh="+yh, "get", null, (res) => {
if(res.code == 0
)
{
getDataList();
alert('接单成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("addjiedan", "addjiedan");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(id) {
window.sessionStorage.setItem("updateId", id);
window.location.href = "info.jsp";
}
//填充级联表搜索下拉框
//填充本表搜索下拉框
function jdztTypesSelectSearch() {
var jdztTypesSelectSearch = document.getElementById('jdztTypesSelectSearch');
if(jdztTypesSelectSearch != null) {
jdztTypesSelectSearch.add(new Option('-请选择-',''));
if (jdztTypesOptions != null && jdztTypesOptions.length > 0){
for (var i = 0; i < jdztTypesOptions.length; i++) {
jdztTypesSelectSearch.add(new Option(jdztTypesOptions[i].indexName,jdztTypesOptions[i].codeIndex));
}
}
}
}
function kdlxTypesSelectSearch() {
var kdlxTypesSelectSearch = document.getElementById('kdlxTypesSelectSearch');
if(kdlxTypesSelectSearch != null) {
kdlxTypesSelectSearch.add(new Option('-请选择-',''));
if (kdlxTypesOptions != null && kdlxTypesOptions.length > 0){
for (var i = 0; i < kdlxTypesOptions.length; i++) {
kdlxTypesSelectSearch.add(new Option(kdlxTypesOptions[i].indexName,kdlxTypesOptions[i].codeIndex));
}
}
}
}
function yonghuSelectSearch() {
var yhSelectSearch = document.getElementById('yhSelectSearch');
if(yhSelectSearch != null) {
yhSelectSearch.add(new Option('-请选择-',''));
if (yonghuOptions != null && yonghuOptions.length > 0){
for (var i = 0; i < yonghuOptions.length; i++) {
yhSelectSearch.add(new Option(yonghuOptions[i].name,yonghuOptions[i].id));
}
}
}
}
//查询级联表搜索条件所有列表
//查询当前表搜索条件所有列表
function jdztTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=jdzt_types", "GET", {}, (res) => {
if(res.code == 0){
jdztTypesOptions = res.data.list;
}
});
}
function kdlxTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=kdlx_types", "GET", {}, (res) => {
if(res.code == 0){
kdlxTypesOptions = res.data.list;
}
});
}
function yonghuSelect() {
//填充下拉框选项
http("yonghu/page?page=1&limit=100", "GET", {}, (res) => {
if(res.code == 0){
yonghuOptions = res.data.list;
}
});
}
$(document).ready(function () {
$('#receive').on('click', function (e) {
e.preventDefault();
var yh = $("#yhSelectSearch").val();
var name = $("#kdname").val();
ship(yh,name);
});
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
//查询当前表的搜索下拉框
jdztTypesSelect();
kdlxTypesSelect();
yonghuSelect();
getDataList();
//级联表的下拉框赋值
//当前表的下拉框赋值
jdztTypesSelectSearch();
yonghuSelectSearch();
kdlxTypesSelectSearch();
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,715 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">已接单表管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">已接单表管理</li>
<li class="breadcrumb-item active">已接单表列表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">已接单表列表</h3>
<div class="table-responsive mb-3">
<div class="col-sm-12">
<label>
接单时间
<input type="datetime-local" id="initiateTimeStartSearch" style="width: 190px;" class="form-control " placeholder="开始" aria-controls="tableId">
</label>
-
<label>
<input type="datetime-local" id="initiateTimeEndSearch" style="width: 190px;" class="form-control" placeholder="结束" aria-controls="tableId">
</label>
<label>
订单状态
<select name="ddztTypesSelectSearch" style="width: 100px;" id="ddztTypesSelectSearch" class="form-control form-control-sm"
aria-controls="tableId">
</select>
</label>
<label>
用户名称
<input type="text" id="nameSearch" style="width: 120px;" class="form-control form-control-sm"
placeholder="用户名称" aria-controls="tableId">
</label>
<button onclick="search()" type="button" class="btn btn-primary">查询</button>
<br/>
<button onclick="add()" type="button" class="btn btn-success 新增">添加</button>
<button onclick="graph()" type="button" class="btn btn-success 报表">报表</button>
<button onclick="deleteMore()" type="button" class="btn btn-danger 删除">批量删除</button>
</div>
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >单号</th>
<th >用户名称</th>
<th >手机号</th>
<th >代取人名称</th>
<th >手机号</th>
<th >接单时间</th>
<th >订单状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
<div class="col-md-6 col-sm-3">
<div class="dataTables_length" id="tableId_length">
<select name="tableId_length" aria-controls="tableId" id="selectPageSize"
onchange="changePageSize()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
条 每页
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item" id="tableId_previous" onclick="pageNumChange('pre')">
<a class="page-link" href="#" tabindex="-1">上一页</a>
</li>
<li class="page-item" id="tableId_next" onclick="pageNumChange('next')">
<a class="page-link" href="#">下一页</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "yijiedan";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
var sexTypesOptions = [];
var sexTypesOptions = [];
var ddztTypesOptions = [];
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
//用户名称
var nameSearchInput = $('#nameSearch');
if( nameSearchInput != null){
if (nameSearchInput.val() != null && nameSearchInput.val() != '') {
searchForm.name = $('#nameSearch').val();
}
}
var sexTypesSelectSearchInput = document.getElementById("sexTypesSelectSearch");
if(sexTypesSelectSearchInput != null){
var sexTypesIndex = sexTypesSelectSearchInput.selectedIndex;
if( sexTypesIndex != 0){
searchForm.sexTypes = document.getElementById("sexTypesSelectSearch").options[sexTypesIndex].value;
}
}
//用户名称
var nameSearchInput = $('#nameSearch');
if( nameSearchInput != null){
if (nameSearchInput.val() != null && nameSearchInput.val() != '') {
searchForm.name = $('#nameSearch').val();
}
}
var sexTypesSelectSearchInput = document.getElementById("sexTypesSelectSearch");
if(sexTypesSelectSearchInput != null){
var sexTypesIndex = sexTypesSelectSearchInput.selectedIndex;
if( sexTypesIndex != 0){
searchForm.sexTypes = document.getElementById("sexTypesSelectSearch").options[sexTypesIndex].value;
}
}
<!-- 本表的查询条件 -->
var initiateTimeStartSearch = $('#initiateTimeStartSearch');
if( initiateTimeStartSearch != null){
if (initiateTimeStartSearch.val() != null && initiateTimeStartSearch.val() != '') {
searchForm.initiateTimeStart = $('#initiateTimeStartSearch').val();
}
}
var initiateTimeEndSearch = $('#initiateTimeEndSearch');
if( initiateTimeEndSearch != null){
if (initiateTimeEndSearch.val() != null && initiateTimeEndSearch.val() != '') {
searchForm.initiateTimeEnd = $('#initiateTimeEndSearch').val();
}
}
//订单状态
var ddztTypesSelectSearchInput = document.getElementById("ddztTypesSelectSearch");
if(ddztTypesSelectSearchInput != null){
var ddztTypesIndex = ddztTypesSelectSearchInput.selectedIndex;
if( ddztTypesIndex != 0){
searchForm.ddztTypes= document.getElementById("ddztTypesSelectSearch").options[ddztTypesIndex].value;
}
}
getDataList();
}
// 获取数据列表
function getDataList() {
http("yijiedan/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
initiateTimeStart: searchForm.initiateTimeStart,
initiateTimeEnd: searchForm.initiateTimeEnd,
ddztTypes: searchForm.ddztTypes,
//级联表的
name: searchForm.name,
sexTypes: searchForm.sexTypes,
name: searchForm.name,
sexTypes: searchForm.sexTypes,
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//单号
var oddCell = document.createElement('td');
oddCell.innerHTML = item.odd;
row.appendChild(oddCell);
//用户名称
var nameCell = document.createElement('td');
nameCell.innerHTML = item.name;
row.appendChild(nameCell);
//手机号
var fbphoneCell = document.createElement('td');
fbphoneCell.innerHTML = item.fbphone;
row.appendChild(fbphoneCell);
//代取人名称
var nameCell = document.createElement('td');
nameCell.innerHTML = item.yhname;
row.appendChild(nameCell);
//手机号
var jdphoneCell = document.createElement('td');
jdphoneCell.innerHTML = item.jdphone;
row.appendChild(jdphoneCell);
//接单时间
var initiateTimeCell = document.createElement('td');
initiateTimeCell.innerHTML = item.initiateTime;
row.appendChild(initiateTimeCell);
//订单状态
var ddztTypesCell = document.createElement('td');
ddztTypesCell.innerHTML = item.ddztValue;
row.appendChild(ddztTypesCell);
//每行按钮
var btnGroup = document.createElement('td');
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "detail(" + item.odd + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 查看");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "查看订单详情"
btnGroup.appendChild(detailBtn)
//修改按钮
var editBtn = document.createElement('button');
var editAttr = 'edit(' + item.id + ')';
editBtn.setAttribute("type", "button");
editBtn.setAttribute("class", "btn btn-warning btn-sm 修改");
editBtn.setAttribute("onclick", editAttr);
editBtn.innerHTML = "修改"
btnGroup.appendChild(editBtn)
//删除按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'remove(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 删除");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "删除"
btnGroup.appendChild(deleteBtn)
if(item.ddztValue == "正在路上"){
//完成按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'accomplish(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 完成");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "确认到达"
btnGroup.appendChild(deleteBtn)
}
row.appendChild(btnGroup)
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("yijiedan/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
//完成
function accomplish(id) {
var mymessage = confirm("真的要确定完成订单吗?");
if (mymessage == true) {
paramArray = id;
httpJson("yijiedan/accomplish", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('确定成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("addyijiedan", "addyijiedan");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(odd) {
window.sessionStorage.setItem("odd", odd);
window.location.href = "jiedan.jsp";
}
//填充级联表搜索下拉框
function sexTypesSelectSearch() {
var sexTypesSelectSearch = document.getElementById('sexTypesSelectSearch');
if(sexTypesSelectSearch != null) {
sexTypesSelectSearch.add(new Option('-请选择-',''));
if (sexTypesOptions != null && sexTypesOptions.length > 0){
for (var i = 0; i < sexTypesOptions.length; i++) {
sexTypesSelectSearch.add(new Option(sexTypesOptions[i].indexName, sexTypesOptions[i].codeIndex));
}
}
}
}
//填充本表搜索下拉框
function ddztTypesSelectSearch() {
var ddztTypesSelectSearch = document.getElementById('ddztTypesSelectSearch');
if(ddztTypesSelectSearch != null) {
ddztTypesSelectSearch.add(new Option('-请选择-',''));
if (ddztTypesOptions != null && ddztTypesOptions.length > 0){
for (var i = 0; i < ddztTypesOptions.length; i++) {
ddztTypesSelectSearch.add(new Option(ddztTypesOptions[i].indexName,ddztTypesOptions[i].codeIndex));
}
}
}
}
function sexTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=sex_types", "GET", {}, (res) => {
if(res.code == 0){
sexTypesOptions = res.data.list;
}
});
}
//查询当前表搜索条件所有列表
function ddztTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=ddzt_types", "GET", {}, (res) => {
if(res.code == 0){
ddztTypesOptions = res.data.list;
}
});
}
$(document).ready(function () {
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
sexTypesSelect();
//查询当前表的搜索下拉框
ddztTypesSelect();
getDataList();
//级联表的下拉框赋值
sexTypesSelectSearch();
//当前表的下拉框赋值
ddztTypesSelectSearch();
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,513 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap-select.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">编辑</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表的字段 -->
<!-- 当前表的字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>学号</label>
<input id="studentnumber" name="studentnumber" class="form-control"
placeholder="学号">
</div>
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
placeholder="用户名称">
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
placeholder="账号">
<input id="yanzheng" name="yanzheng" type="hidden" value="1" class="form-control"
placeholder="验证">
</div>
<div class="form-group col-md-6">
<label>性别</label>
<select id="sexTypesSelect" name="sexTypes" class="form-control">
</select>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" src="" width="100" height="100">
<input name="file" type="file" id="imgPhotoupload"
class="form-control-file">
<input name="imgPhoto" id="imgPhoto-input" type="hidden">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
onchange="phoneChickValue(this)" placeholder="联系电话">
</div>
<div class="form-group col-md-6">
<label>住宿楼栋</label>
<input id="zhuSuLou" name="zhuSuLou" class="form-control"
placeholder="住宿楼栋">
</div>
<div class="form-group col-md-6">
<label>寝室号</label>
<input id="dormitory" name="dormitory" class="form-control"
placeholder="寝室号">
</div>
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">提交</button>
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js">
</script><script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap-select.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "yonghu";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
// 下拉框数组
<!-- 当前表的下拉框数组 -->
var sexTypesOptions = [];
<!-- 级联表的下拉框数组 -->
var ruleForm = {};
// 文件上传
function upload() {
<!-- 当前表的文件上传 -->
$('#imgPhotoupload').fileupload({
url: baseUrl + 'file/upload',
headers: {token: window.sessionStorage.getItem("token")},
dataType: 'json',
done: function (e, data) {
var photoUrl= baseUrl + 'file/download?fileName=' + data.result.file;
document.getElementById('imgPhotoImg').setAttribute('src',photoUrl);
document.getElementById('imgPhoto-input').setAttribute('value',photoUrl);
}
});
}
// 表单提交
function submit() {
if (validform() == true && compare() == true) {
let data = {};
getContent();
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
var urlParam;
var successMes = '';
if (updateId != null && updateId != "null" && updateId != '') {
urlParam = 'update';
successMes = '修改成功';
} else {
urlParam = 'save';
successMes = '添加成功';
}
httpJson("yonghu/" + urlParam, "POST", data, (res) => {
if(res.code == 0)
{
window.sessionStorage.removeItem('addyonghu');
window.sessionStorage.removeItem('updateId');
let flag = true;
if (flag) {
alert(successMes);
}
if (window.sessionStorage.getItem('onlyme') != null && window.sessionStorage.getItem('onlyme') == "true") {
window.sessionStorage.removeItem('onlyme');
window.sessionStorage.setItem("reload","reload");
window.parent.location.href = "${pageContext.request.contextPath}/index.jsp";
} else {
window.location.href = "../home/home.jsp";
}
}
});
} else {
alert("表单未填完整或有错误");
}
}
// 查询列表
<!-- 查询当前表的所有列表 -->
function sexTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=sex_types", "GET", {}, (res) => {
if(res.code == 0){
sexTypesOptions = res.data.list;
}
});
}
<!-- 查询级联表的所有列表 -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
function initializationSextypesSelect(){
var sexTypesSelect = document.getElementById('sexTypesSelect');
if(sexTypesSelect != null && sexTypesOptions != null && sexTypesOptions.length > 0 ){
for (var i = 0; i < sexTypesOptions.length; i++) {
sexTypesSelect.add(new Option(sexTypesOptions[i].indexName,sexTypesOptions[i].codeIndex));
}
}
}
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
// 下拉框选项回显
function setSelectOption() {
<!-- 当前表的下拉框回显 -->
var sexTypesSelect = document.getElementById("sexTypesSelect");
if(sexTypesSelect != null && sexTypesOptions != null && sexTypesOptions.length > 0 ) {
for (var i = 0; i < sexTypesOptions.length; i++) {
if (sexTypesOptions[i].codeIndex == ruleForm.sexTypes) {//下拉框value对比,如果一致就赋值汉字
sexTypesSelect.options[i].selected = true;
}
}
}
<!-- 级联表的下拉框回显 -->
}
// 填充富文本框
function setContent() {
<!-- 当前表的填充富文本框 -->
}
// 获取富文本框内容
function getContent() {
<!-- 获取当前表的富文本框内容 -->
}
//数字检查
<!-- 当前表的数字检查 -->
function phoneChickValue(e){
var this_val = e.value || 0;
var reg=/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if(!reg.test(this_val)){
e.value = "";
alert("手机号不正确");
return false;
}
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addyonghu');
window.location.href = "../home/home.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
studentnumber: "required",
name: "required",
username: "required",
password: "required",
sexTypes: "required",
imgPhoto: "required",
phone: "required",
zhuSuLou: "required",
dormitory: "required",
role: "required",
},
messages: {
studentnumber: "学号不能为空",
name: "用户名称不能为空",
username: "账号不能为空",
password: "密码不能为空",
sexTypes: "性别不能为空",
imgPhoto: "头像不能为空",
phone: "联系电话不能为空",
zhuSuLou: "住宿楼栋不能为空",
dormitory: "寝室号不能为空",
role: "身份不能为空",
}
}).form();
}
// 获取当前详情
function getDetails() {
var addyonghu = window.sessionStorage.getItem("addyonghu");
if (addyonghu != null && addyonghu != "" && addyonghu != "null") {
window.sessionStorage.removeItem('addyonghu');
//注册表单验证
$(validform());
$('#submitBtn').text('新增');
} else {
$('#submitBtn').text('修改');
var userId = window.sessionStorage.getItem('userId');
updateId = userId;//先赋值登录用户id
var uId = window.sessionStorage.getItem('updateId');//获取修改传过来的id
if (uId != null && uId != "" && uId != "null") {
//如果修改id不为空就赋值修改id
updateId = uId;
}
window.sessionStorage.removeItem('updateId');
http("yonghu/info/" + updateId, "GET", {}, (res) => {
if(res.code == 0)
{
ruleForm = res.data
// 是/否下拉框回显
setSelectOption();
// 设置图片src
showImg();
// 数据填充
dataBind();
// 富文本框回显
setContent();
//注册表单验证
$(validform());
}
});
}
}
// 清除可能会重复渲染的selection
function clear(className) {
var elements = document.getElementsByClassName(className);
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
function dateTimePick() {
}
function dataBind() {
<!-- 级联表的数据回显 -->
<!-- 当前表的数据回显 -->
$("#updateId").val(ruleForm.id);
$("#studentnumber").val(ruleForm.studentnumber);
$("#name").val(ruleForm.name);
$("#username").val(ruleForm.username);
$("#password").val(ruleForm.password);
$("#phone").val(ruleForm.phone);
$("#zhuSuLou").val(ruleForm.zhuSuLou);
$("#dormitory").val(ruleForm.dormitory);
$("#role").val(ruleForm.role);
}
<!-- 级联表的数据回显 -->
//图片显示
function showImg() {
<!-- 当前表的图片 -->
$("#imgPhotoImg").attr("src",ruleForm.imgPhoto);
<!-- 级联表的图片 -->
}
<!-- 级联表的图片 -->
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
//设置导航栏菜单
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
//初始化时间插件
dateTimePick();
//查询所有下拉框
<!-- 当前表的下拉框 -->
sexTypesSelect();
<!-- 查询级联表的下拉框(用id做option,用名字及其他参数做名字级联修改) -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
initializationSextypesSelect();
<!-- 初始化级联表的下拉框 -->
$(".selectpicker" ).selectpicker('refresh');
getDetails();
//初始化上传按钮
upload();
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
readonly();
});
function readonly() {
if (window.sessionStorage.getItem('role') != '管理员') {
$('#jifen').attr('readonly', 'readonly');
//$('#money').attr('readonly', 'readonly');
}
}
//比较大小
function compare() {
var largerVal = null;
var smallerVal = null;
if (largerVal != null && smallerVal != null) {
if (largerVal <= smallerVal) {
alert(smallerName + '不能大于等于' + largerName);
return false;
}
}
return true;
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,266 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" id="navUl">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">登记</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表所有字段 -->
<!-- 本表所有字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>学号</label>
<input id="studentnumber" name="studentnumber" class="form-control"
v-model="ruleForm.studentnumber" readonly>
</div>
<div class="form-group col-md-6">
<label>用户名称</label>
<input id="name" name="name" class="form-control"
v-model="ruleForm.name" readonly>
</div>
<div class="form-group col-md-6">
<label>账号</label>
<input id="username" name="username" class="form-control"
v-model="ruleForm.username" readonly>
</div>
<div class="form-group col-md-6">
<label>性别</label>
<input id="sexValue" name="sexValue" class="form-control"
v-model="ruleForm.sexValue" readonly>
</div>
<div class="form-group col-md-6">
<label>头像</label>
<img id="imgPhotoImg" width="100" height="100">
</div>
<div class="form-group col-md-6">
<label>联系电话</label>
<input id="phone" name="phone" class="form-control"
v-model="ruleForm.phone" readonly>
</div>
<div class="form-group col-md-6">
<label>住宿楼栋</label>
<input id="zhuSuLou" name="zhuSuLou" class="form-control"
v-model="ruleForm.zhuSuLou" readonly>
</div>
<div class="form-group col-md-6">
<label>寝室号</label>
<input id="dormitory" name="dormitory" class="form-control"
v-model="ruleForm.dormitory" readonly>
</div>
<div class="form-group col-md-6">
<label>身份</label>
<input id="role" name="role" class="form-control"
v-model="ruleForm.role" readonly>
</div>
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "yonghu";
var pageType = "add-or-update";
var updateId = "";
var sexTypesOptions = [];
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "yonghu/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
ruleForm = res.data;
showImg();
setContent();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 填充富文本框
function setContent() {
}
//图片显示
function showImg() {
$("#imgPhotoImg").attr("src", ruleForm.imgPhoto);
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addyonghu');
window.location.href = "list.jsp";
}
// 下载
function download(fileName) {
var url = baseUrl+'file/download?fileName='+fileName;
window.open(url);
}
//设置下载
function setDownloadBtn() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,656 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">管理</li>
<li class="breadcrumb-item active">列表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">列表</h3>
<div class="table-responsive mb-3">
<div class="col-sm-12">
<label>
用户名称
<input type="text" id="nameSearch" style="width: 140px;" class="form-control form-control-sm"
placeholder="用户名称" aria-controls="tableId">
</label>
<label>
性别
<select name="sexTypesSelectSearch" style="width: 100px;" id="sexTypesSelectSearch" class="form-control form-control-sm"
aria-controls="tableId">
</select>
</label>
<button onclick="search()" type="button" class="btn btn-primary">查询</button>
<br/>
<button onclick="add()" type="button" class="btn btn-success 新增">添加</button>
<button onclick="graph()" type="button" class="btn btn-success 报表">报表</button>
<button onclick="deleteMore()" type="button" class="btn btn-danger 删除">批量删除</button>
</div>
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >学号</th>
<th >用户名称</th>
<th >账号</th>
<th >性别</th>
<th >头像</th>
<th >联系电话</th>
<th >住宿楼栋</th>
<th >寝室号</th>
<th >身份</th>
<th>操作</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
<div class="col-md-6 col-sm-3">
<div class="dataTables_length" id="tableId_length">
<select name="tableId_length" aria-controls="tableId" id="selectPageSize"
onchange="changePageSize()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
条 每页
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item" id="tableId_previous" onclick="pageNumChange('pre')">
<a class="page-link" href="#" tabindex="-1">上一页</a>
</li>
<li class="page-item" id="tableId_next" onclick="pageNumChange('next')">
<a class="page-link" href="#">下一页</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "yonghu";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
var sexTypesOptions = [];
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
<!-- 本表的查询条件 -->
//用户名称
var nameSearchInput = $('#nameSearch');
if( nameSearchInput != null){
if (nameSearchInput.val() != null && nameSearchInput.val() != '') {
searchForm.name = $('#nameSearch').val();
}
}
//性别
var sexTypesSelectSearchInput = document.getElementById("sexTypesSelectSearch");
if(sexTypesSelectSearchInput != null){
var sexTypesIndex = sexTypesSelectSearchInput.selectedIndex;
if( sexTypesIndex != 0){
searchForm.sexTypes= document.getElementById("sexTypesSelectSearch").options[sexTypesIndex].value;
}
}
getDataList();
}
// 获取数据列表
function getDataList() {
http("yonghu/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
name: searchForm.name,
sexTypes: searchForm.sexTypes,
//级联表的
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//学号
var studentnumberCell = document.createElement('td');
studentnumberCell.innerHTML = item.studentnumber;
row.appendChild(studentnumberCell);
//用户名称
var nameCell = document.createElement('td');
nameCell.innerHTML = item.name;
row.appendChild(nameCell);
//账号
var usernameCell = document.createElement('td');
usernameCell.innerHTML = item.username;
row.appendChild(usernameCell);
//性别
var sexTypesCell = document.createElement('td');
sexTypesCell.innerHTML = item.sexValue;
row.appendChild(sexTypesCell);
//头像
var imgPhotoCell = document.createElement('td');
var imgPhotoImg = document.createElement('img');
var imgPhotoImgValue = item.imgPhoto;
if(imgPhotoImgValue !=null && imgPhotoImgValue !='' && imgPhotoImgValue !='null'){
imgPhotoImg.setAttribute('src', imgPhotoImgValue);
imgPhotoImg.setAttribute('height', 100);
imgPhotoImg.setAttribute('width', 100);
imgPhotoCell.appendChild(imgPhotoImg);
}else{
imgPhotoCell.innerHTML = "暂无图片";
}
row.appendChild(imgPhotoCell);
//联系电话
var phoneCell = document.createElement('td');
phoneCell.innerHTML = item.phone;
row.appendChild(phoneCell);
//住宿楼栋
var zhuSuLouCell = document.createElement('td');
zhuSuLouCell.innerHTML = item.zhuSuLou;
row.appendChild(zhuSuLouCell);
//寝室号
var dormitoryCell = document.createElement('td');
dormitoryCell.innerHTML = item.dormitory;
row.appendChild(dormitoryCell);
//身份
var roleCell = document.createElement('td');
roleCell.innerHTML = item.role;
row.appendChild(roleCell);
//每行按钮
var btnGroup = document.createElement('td');
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "detail(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 查看");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "查看"
btnGroup.appendChild(detailBtn)
//修改按钮
var editBtn = document.createElement('button');
var editAttr = 'edit(' + item.id + ')';
editBtn.setAttribute("type", "button");
editBtn.setAttribute("class", "btn btn-warning btn-sm 修改");
editBtn.setAttribute("onclick", editAttr);
editBtn.innerHTML = "修改"
btnGroup.appendChild(editBtn)
//删除按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'remove(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 删除");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "删除"
btnGroup.appendChild(deleteBtn)
if(item.yanzheng != 1){
var detailBtn = document.createElement('button');
var detailAttr = "yanz(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 删除");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "同意注册"
btnGroup.appendChild(detailBtn)
}
row.appendChild(btnGroup)
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("yonghu/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 删除
function yanz(id) {
var mymessage = confirm("真的要同意吗?");
if (mymessage == true) {
http("yonghu/yanz?ids="+id, "get", {}, (res) => {
if(res.code == 0
)
{
getDataList();
alert('操作成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("addyonghu", "addyonghu");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(id) {
window.sessionStorage.setItem("updateId", id);
window.location.href = "info.jsp";
}
//填充级联表搜索下拉框
//填充本表搜索下拉框
function sexTypesSelectSearch() {
var sexTypesSelectSearch = document.getElementById('sexTypesSelectSearch');
if(sexTypesSelectSearch != null) {
sexTypesSelectSearch.add(new Option('-请选择-',''));
if (sexTypesOptions != null && sexTypesOptions.length > 0){
for (var i = 0; i < sexTypesOptions.length; i++) {
sexTypesSelectSearch.add(new Option(sexTypesOptions[i].indexName,sexTypesOptions[i].codeIndex));
}
}
}
}
//查询级联表搜索条件所有列表
//查询当前表搜索条件所有列表
function sexTypesSelect() {
//填充下拉框选项
http("dictionary/page?page=1&limit=100&sort=&order=&dicCode=sex_types", "GET", {}, (res) => {
if(res.code == 0){
sexTypesOptions = res.data.list;
}
});
}
$(document).ready(function () {
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
//查询当前表的搜索下拉框
sexTypesSelect();
getDataList();
//级联表的下拉框赋值
//当前表的下拉框赋值
sexTypesSelectSearch();
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,407 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap-select.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
.error {
color: red;
}
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑快递站点</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">快递站点管理</li>
<li class="breadcrumb-item active">编辑快递站点</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">快递站点信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表的字段 -->
<!-- 当前表的字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>站点名称</label>
<input id="zdname" name="zdname" class="form-control"
placeholder="站点名称">
</div>
<div class="form-group col-md-6">
<label>站点地址</label>
<input id="address" name="address" class="form-control"
placeholder="站点地址">
</div>
<div class="form-group col-md-12 mb-3">
<button id="submitBtn" type="button" class="btn btn-primary btn-lg">提交</button>
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.fileupload.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/jquery.validate.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/messages_zh.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/validate/card.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/datetimepicker/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js">
</script><script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/js/bootstrap-select.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "zhandian";
var pageType = "add-or-update";
var updateId = "";
var crossTableId = -1;
var crossTableName = '';
var ruleForm = {};
var crossRuleForm = {};
// 下拉框数组
<!-- 当前表的下拉框数组 -->
<!-- 级联表的下拉框数组 -->
var ruleForm = {};
// 文件上传
function upload() {
<!-- 当前表的文件上传 -->
}
// 表单提交
function submit() {
if (validform() == true && compare() == true) {
let data = {};
getContent();
let value = $('#addOrUpdateForm').serializeArray();
$.each(value, function (index, item) {
data[item.name] = item.value;
});
let json = JSON.stringify(data);
var urlParam;
var successMes = '';
if (updateId != null && updateId != "null" && updateId != '') {
urlParam = 'update';
successMes = '修改成功';
} else {
urlParam = 'save';
successMes = '添加成功';
}
httpJson("zhandian/" + urlParam, "POST", data, (res) => {
if(res.code == 0)
{
window.sessionStorage.removeItem('addzhandian');
window.sessionStorage.removeItem('updateId');
let flag = true;
if (flag) {
alert(successMes);
}
if (window.sessionStorage.getItem('onlyme') != null && window.sessionStorage.getItem('onlyme') == "true") {
window.sessionStorage.removeItem('onlyme');
window.sessionStorage.setItem("reload","reload");
window.parent.location.href = "${pageContext.request.contextPath}/index.jsp";
} else {
window.location.href = "list.jsp";
}
}
});
} else {
alert("表单未填完整或有错误");
}
}
// 查询列表
<!-- 查询当前表的所有列表 -->
<!-- 查询级联表的所有列表 -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
<!-- 初始化级联表的下拉框(要根据内容修改) -->
// 下拉框选项回显
function setSelectOption() {
<!-- 当前表的下拉框回显 -->
<!-- 级联表的下拉框回显 -->
}
// 填充富文本框
function setContent() {
<!-- 当前表的填充富文本框 -->
}
// 获取富文本框内容
function getContent() {
<!-- 获取当前表的富文本框内容 -->
}
//数字检查
<!-- 当前表的数字检查 -->
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addzhandian');
window.location.href = "list.jsp";
}
// 表单校验
function validform() {
return $("#addOrUpdateForm").validate({
rules: {
zdname: "required",
address: "required",
},
messages: {
zdname: "站点名称不能为空",
address: "站点地址不能为空",
}
}).form();
}
// 获取当前详情
function getDetails() {
var addzhandian = window.sessionStorage.getItem("addzhandian");
if (addzhandian != null && addzhandian != "" && addzhandian != "null") {
window.sessionStorage.removeItem('addzhandian');
//注册表单验证
$(validform());
$('#submitBtn').text('新增');
} else {
$('#submitBtn').text('修改');
var userId = window.sessionStorage.getItem('userId');
updateId = userId;//先赋值登录用户id
var uId = window.sessionStorage.getItem('updateId');//获取修改传过来的id
if (uId != null && uId != "" && uId != "null") {
//如果修改id不为空就赋值修改id
updateId = uId;
}
window.sessionStorage.removeItem('updateId');
http("zhandian/info/" + updateId, "GET", {}, (res) => {
if(res.code == 0)
{
ruleForm = res.data
// 是/否下拉框回显
setSelectOption();
// 设置图片src
showImg();
// 数据填充
dataBind();
// 富文本框回显
setContent();
//注册表单验证
$(validform());
}
});
}
}
// 清除可能会重复渲染的selection
function clear(className) {
var elements = document.getElementsByClassName(className);
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
function dateTimePick() {
}
function dataBind() {
<!-- 级联表的数据回显 -->
<!-- 当前表的数据回显 -->
$("#updateId").val(ruleForm.id);
$("#zdname").val(ruleForm.zdname);
$("#address").val(ruleForm.address);
}
<!-- 级联表的数据回显 -->
//图片显示
function showImg() {
<!-- 当前表的图片 -->
<!-- 级联表的图片 -->
}
<!-- 级联表的图片 -->
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
//设置导航栏菜单
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
//初始化时间插件
dateTimePick();
//查询所有下拉框
<!-- 当前表的下拉框 -->
<!-- 查询级联表的下拉框(用id做option,用名字及其他参数做名字级联修改) -->
// 初始化下拉框
<!-- 初始化当前表的下拉框 -->
<!-- 初始化级联表的下拉框 -->
$(".selectpicker" ).selectpicker('refresh');
getDetails();
//初始化上传按钮
upload();
<%@ include file="../../static/myInfo.js"%>
$('#submitBtn').on('click', function (e) {
e.preventDefault();
//console.log("点击了...提交按钮");
submit();
});
readonly();
});
function readonly() {
if (window.sessionStorage.getItem('role') != '管理员') {
$('#jifen').attr('readonly', 'readonly');
//$('#money').attr('readonly', 'readonly');
}
}
//比较大小
function compare() {
var largerVal = null;
var smallerVal = null;
if (largerVal != null && smallerVal != null) {
if (largerVal <= smallerVal) {
alert(smallerName + '不能大于等于' + largerName);
return false;
}
}
return true;
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,218 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<%@ include file="../../static/head.jsp" %>
<link href="http://www.bootcss.com/p/bootstrap-datetimepicker/bootstrap-datetimepicker/css/datetimepicker.css"
rel="stylesheet">
<script type="text/javascript" charset="utf-8">
window.UEDITOR_HOME_URL = "${pageContext.request.contextPath}/resources/ueditor/"; //UEDITOR_HOME_URL、config、all这三个顺序不能改变
</script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8"
src="${pageContext.request.contextPath}/resources/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto" id="navUl">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">编辑快递站点</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">快递站点管理</li>
<li class="breadcrumb-item active">快递站点登记</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">快递站点信息</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<!-- 级联表所有字段 -->
<!-- 本表所有字段 -->
<input id="updateId" name="id" type="hidden">
<div class="form-group col-md-6">
<label>站点名称</label>
<input id="zdname" name="zdname" class="form-control"
v-model="ruleForm.zdname" readonly>
</div>
<div class="form-group col-md-6">
<label>站点地址</label>
<input id="address" name="address" class="form-control"
v-model="ruleForm.address" readonly>
</div>
<div class="form-group col-md-12 mb-3">
<button id="exitBtn" type="button" class="btn btn-primary btn-lg">返回</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script src="${pageContext.request.contextPath}/resources/js/vue.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
var tableName = "zhandian";
var pageType = "add-or-update";
var updateId = "";
var ruleForm = {};
var vm = new Vue({
el: '#addOrUpdateForm',
data: {
ruleForm: {},
},
beforeCreate: function () {
var id = window.sessionStorage.getItem("updateId");
if (id != null && id != "" && id != "null") {
$.ajax({
type: "GET",
url: baseUrl + "zhandian/info/" + id,
beforeSend: function (xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function (res) {
if (res.code == 0) {
vm.ruleForm = res.data;
ruleForm = res.data;
showImg();
setContent();
} else if (res.code == 401) {
<%@ include file="../../static/toLogin.jsp"%>
} else {
alert(res.msg)
}
},
});
}
},
methods: {}
});
// 填充富文本框
function setContent() {
}
//图片显示
function showImg() {
}
function exit() {
window.sessionStorage.removeItem("updateId");
window.sessionStorage.removeItem('addzhandian');
window.location.href = "list.jsp";
}
// 下载
function download(fileName) {
var url = baseUrl+'file/download?fileName='+fileName;
window.open(url);
}
//设置下载
function setDownloadBtn() {
}
$(document).ready(function () {
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
$('#exitBtn').on('click', function (e) {
e.preventDefault();
exit();
});
<%@ include file="../../static/myInfo.js"%>
});
// 用户登出
<%@ include file="../../static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,529 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="../../static/head.jsp" %>
<!-- font-awesome -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/font-awesome.min.css">
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="../../static/topNav.jsp" %>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">快递站点管理</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="${pageContext.request.contextPath}/index.jsp">
<span class="ti-home"></span>
</a>
</li>
<li class="breadcrumb-item">快递站点管理</li>
<li class="breadcrumb-item active">快递站点列表</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">快递站点列表</h3>
<div class="table-responsive mb-3">
<div class="col-sm-12">
<label>
站点名称
<input type="text" id="zdnameSearch" style="width: 140px;" class="form-control form-control-sm"
placeholder="站点名称" aria-controls="tableId">
</label>
<button onclick="search()" type="button" class="btn btn-primary">查询</button>
<br/>
<button onclick="add()" type="button" class="btn btn-success 新增">添加</button>
<button onclick="graph()" type="button" class="btn btn-success 报表">报表</button>
<button onclick="deleteMore()" type="button" class="btn btn-danger 删除">批量删除</button>
</div>
<table id="tableId" class="table table-bordered table-striped">
<thead>
<tr>
<th class="no-sort" style="min-width: 35px;">
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="select-all"
onclick="chooseAll()">
<label class="custom-control-label" for="select-all"></label>
</div>
</th>
<th >站点名称</th>
<th >站点地址</th>
<th>操作</th>
</tr>
</thead>
<tbody id="thisTbody">
</tbody>
</table>
<div class="col-md-6 col-sm-3">
<div class="dataTables_length" id="tableId_length">
<select name="tableId_length" aria-controls="tableId" id="selectPageSize"
onchange="changePageSize()">
<option value="10">10</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
条 每页
</div>
</div>
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end">
<li class="page-item" id="tableId_previous" onclick="pageNumChange('pre')">
<a class="page-link" href="#" tabindex="-1">上一页</a>
</li>
<li class="page-item" id="tableId_next" onclick="pageNumChange('next')">
<a class="page-link" href="#">下一页</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top">
<span class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="../../static/foot.jsp" %>
<script language="javascript" type="text/javascript"
src="${pageContext.request.contextPath}/resources/My97DatePicker/WdatePicker.js"></script>
<script>
<%@ include file="../../utils/menu.jsp"%>
<%@ include file="../../static/setMenu.js"%>
<%@ include file="../../utils/baseUrl.jsp"%>
<%@ include file="../../static/getRoleButtons.js"%>
<%@ include file="../../static/crossBtnControl.js"%>
var tableName = "zhandian";
var pageType = "list";
var searchForm = {key: ""};
var pageIndex = 1;
var pageSize = 10;
var totalPage = 0;
var dataList = [];
var sortColumn = '';
var sortOrder = '';
var ids = [];
var checkAll = false;
function init() {
// 满足条件渲染提醒接口
}
// 改变每页记录条数
function changePageSize() {
var selection = document.getElementById('selectPageSize');
var index = selection.selectedIndex;
pageSize = selection.options[index].value;
getDataList();
}
// 查询
function search() {
searchForm = {key: ""};
<!-- 级联表的级联字典表 -->
<!-- 本表的查询条件 -->
//站点名称
var zdnameSearchInput = $('#zdnameSearch');
if( zdnameSearchInput != null){
if (zdnameSearchInput.val() != null && zdnameSearchInput.val() != '') {
searchForm.zdname = $('#zdnameSearch').val();
}
}
getDataList();
}
// 获取数据列表
function getDataList() {
http("zhandian/page", "GET", {
page: pageIndex,
limit: pageSize,
sort: sortColumn,
order: sortOrder,
//本表的
zdname: searchForm.zdname,
//级联表的
}, (res) => {
if(res.code == 0)
{
clear();
$("#thisTbody").html("");
dataList = res.data.list;
totalPage = res.data.totalPage;
//var tbody = document.getElementById('tbMain');
for (var i = 0; i < dataList.length; i++) { //遍历一下表格数据  
var trow = setDataRow(dataList[i], i); //定义一个方法,返回tr数据 
$('#thisTbody').append(trow);
}
pagination(); //渲染翻页组件
getRoleButtons();// 权限按钮控制
}
})
;
}
// 渲染表格数据
function setDataRow(item, number) {
//创建行 
var row = document.createElement('tr');
row.setAttribute('class', 'useOnce');
//创建勾选框
var checkbox = document.createElement('td');
var checkboxDiv = document.createElement('div');
checkboxDiv.setAttribute("class", "custom-control custom-checkbox");
var checkboxInput = document.createElement('input');
checkboxInput.setAttribute("class", "custom-control-input");
checkboxInput.setAttribute("type", "checkbox");
checkboxInput.setAttribute('name', 'chk');
checkboxInput.setAttribute('value', item.id);
checkboxInput.setAttribute("id", number);
checkboxDiv.appendChild(checkboxInput);
var checkboxLabel = document.createElement('label');
checkboxLabel.setAttribute("class", "custom-control-label");
checkboxLabel.setAttribute("for", number);
checkboxDiv.appendChild(checkboxLabel);
checkbox.appendChild(checkboxDiv);
row.appendChild(checkbox)
//站点名称
var zdnameCell = document.createElement('td');
zdnameCell.innerHTML = item.zdname;
row.appendChild(zdnameCell);
//站点地址
var addressCell = document.createElement('td');
addressCell.innerHTML = item.address;
row.appendChild(addressCell);
//每行按钮
var btnGroup = document.createElement('td');
//详情按钮
var detailBtn = document.createElement('button');
var detailAttr = "detail(" + item.id + ')';
detailBtn.setAttribute("type", "button");
detailBtn.setAttribute("class", "btn btn-info btn-sm 查看");
detailBtn.setAttribute("onclick", detailAttr);
detailBtn.innerHTML = "查看"
btnGroup.appendChild(detailBtn)
//修改按钮
var editBtn = document.createElement('button');
var editAttr = 'edit(' + item.id + ')';
editBtn.setAttribute("type", "button");
editBtn.setAttribute("class", "btn btn-warning btn-sm 修改");
editBtn.setAttribute("onclick", editAttr);
editBtn.innerHTML = "修改"
btnGroup.appendChild(editBtn)
//删除按钮
var deleteBtn = document.createElement('button');
var deleteAttr = 'remove(' + item.id + ')';
deleteBtn.setAttribute("type", "button");
deleteBtn.setAttribute("class", "btn btn-danger btn-sm 删除");
deleteBtn.setAttribute("onclick", deleteAttr);
deleteBtn.innerHTML = "删除"
btnGroup.appendChild(deleteBtn)
row.appendChild(btnGroup)
return row;
}
// 翻页
function pageNumChange(val) {
if (val == 'pre') {
pageIndex--;
} else if (val == 'next') {
pageIndex++;
} else {
pageIndex = val;
}
getDataList();
}
// 下载
function download(url) {
window.open(url);
}
// 渲染翻页组件
function pagination() {
var beginIndex = pageIndex;
var endIndex = pageIndex;
var point = 4;
//计算页码
for (var i = 0; i < 3; i++) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
for (var i = 0; i < 3; i++) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--;
}
if (point > 0) {
while (point > 0) {
if (endIndex == totalPage) {
break;
}
endIndex++;
point--;
}
while (point > 0) {
if (beginIndex == 1) {
break;
}
beginIndex--;
point--
}
}
// 是否显示 前一页 按钮
if (pageIndex > 1) {
$('#tableId_previous').show();
} else {
$('#tableId_previous').hide();
}
// 渲染页码按钮
for (var i = beginIndex; i <= endIndex; i++) {
var pageNum = document.createElement('li');
pageNum.setAttribute('onclick', "pageNumChange(" + i + ")");
if (pageIndex == i) {
pageNum.setAttribute('class', 'paginate_button page-item active useOnce');
} else {
pageNum.setAttribute('class', 'paginate_button page-item useOnce');
}
var pageHref = document.createElement('a');
pageHref.setAttribute('class', 'page-link');
pageHref.setAttribute('href', '#');
pageHref.setAttribute('aria-controls', 'tableId');
pageHref.setAttribute('data-dt-idx', i);
pageHref.setAttribute('tabindex', 0);
pageHref.innerHTML = i;
pageNum.appendChild(pageHref);
$('#tableId_next').before(pageNum);
}
// 是否显示 下一页 按钮
if (pageIndex < totalPage) {
$('#tableId_next').show();
$('#tableId_next a').attr('data-dt-idx', endIndex + 1);
} else {
$('#tableId_next').hide();
}
var pageNumInfo = "当前第 " + pageIndex + " 页,共 " + totalPage + " 页";
$('#tableId_info').html(pageNumInfo);
}
// 跳转到指定页
function toThatPage() {
//var index = document.getElementById('pageIndexInput').value;
if (index < 0 || index > totalPage) {
alert('请输入正确的页码');
} else {
pageNumChange(index);
}
}
// 全选/全不选
function chooseAll() {
checkAll = !checkAll;
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
boxs[i].checked = checkAll;
}
}
// 批量删除
function deleteMore() {
ids = []
var boxs = document.getElementsByName("chk");
for (var i = 0; i < boxs.length; i++) {
if (boxs[i].checked) {
ids.push(boxs[i].value)
}
}
if (ids.length == 0) {
alert('请勾选要删除的记录');
} else {
remove(ids);
}
}
// 删除
function remove(id) {
var mymessage = confirm("真的要删除吗?");
if (mymessage == true) {
var paramArray = [];
if (id == ids) {
paramArray = id;
} else {
paramArray.push(id);
}
httpJson("zhandian/delete", "POST", paramArray, (res) => {
if(res.code == 0
)
{
getDataList();
alert('删除成功');
}
})
;
}
else {
alert("已取消操作");
}
}
// 用户登出
<%@ include file="../../static/logout.jsp"%>
//修改
function edit(id) {
window.sessionStorage.setItem('updateId', id)
window.location.href = "add-or-update.jsp"
}
//清除会重复渲染的节点
function clear() {
var elements = document.getElementsByClassName('useOnce');
for (var i = elements.length - 1; i >= 0; i--) {
elements[i].parentNode.removeChild(elements[i]);
}
}
//添加
function add() {
window.sessionStorage.setItem("addzhandian", "addzhandian");
window.location.href = "add-or-update.jsp"
}
//报表
function graph() {
window.location.href = "graph.jsp"
}
// 查看详情
function detail(id) {
window.sessionStorage.setItem("updateId", id);
window.location.href = "info.jsp";
}
//填充级联表搜索下拉框
//填充本表搜索下拉框
//查询级联表搜索条件所有列表
//查询当前表搜索条件所有列表
$(document).ready(function () {
//激活翻页按钮
$('#tableId_previous').attr('class', 'paginate_button page-item previous')
$('#tableId_next').attr('class', 'paginate_button page-item next')
//隐藏原生搜索框
$('#tableId_filter').hide()
//设置右上角用户名
$('.dropdown-menu h5').html(window.sessionStorage.getItem('username'))
//设置项目名
$('.sidebar-header h3 a').html(projectName)
setMenu();
init();
//查询级联表的搜索下拉框
//查询当前表的搜索下拉框
getDataList();
//级联表的下拉框赋值
//当前表的下拉框赋值
<%@ include file="../../static/myInfo.js"%>
});
</script>
</body>
</html>

@ -0,0 +1,179 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<%@ include file="static/head.jsp"%>
</head>
<style>
</style>
<body>
<!-- Pre Loader -->
<div class="loading">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--/Pre Loader -->
<div class="wrapper">
<!-- Page Content -->
<div id="content">
<!-- Top Navigation -->
<%@ include file="static/topNav.jsp"%>
<!-- Menu -->
<div class="container menu-nav">
<nav class="navbar navbar-expand-lg lochana-bg text-white">
<button class="navbar-toggler" type="button" data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false"
aria-label="Toggle navigation">
<span class="ti-menu text-white"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul id="navUl" class="navbar-nav mr-auto">
</ul>
</div>
</nav>
</div>
<!-- /Menu -->
<!-- Breadcrumb -->
<!-- Page Title -->
<div class="container mt-0">
<div class="row breadcrumb-bar">
<div class="col-md-6">
<h3 class="block-title">支付</h3>
</div>
<div class="col-md-6">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a
href="${pageContext.request.contextPath}/index.jsp"> <span
class="ti-home"></span>
</a></li>
<li class="breadcrumb-item">支付</li>
</ol>
</div>
</div>
</div>
<!-- /Page Title -->
<!-- /Breadcrumb -->
<!-- Main Content -->
<div class="container">
<div class="row">
<!-- Widget Item -->
<div class="col-md-12">
<div class="widget-area-2 lochana-box-shadow">
<h3 class="widget-title">请选择支付方式</h3>
<form id="addOrUpdateForm">
<div class="form-row">
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios" checked>
<img src="${pageContext.request.contextPath}/resources/images/bank/微信支付.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/支付宝支付.png" width="200" height="100">
</div>
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/交通银行.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/招商银行.png" width="200" height="100">
</div>
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国农业银行.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国建设银行.png" width="200" height="100">
</div>
<div class="form-group col-md-6">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国银行.png" width="200" height="100">
<input type="radio" name="optionsRadios">
<img src="${pageContext.request.contextPath}/resources/images/bank/中国邮政储蓄银行.png" width="200" height="100">
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-6 mb-3">
<button id="submitBtn" type="button"
class="btn btn-primary btn-lg">支付</button>
</div>
</div>
</form>
</div>
</div>
<!-- /Widget Item -->
</div>
</div>
<!-- /Main Content -->
</div>
<!-- /Page Content -->
</div>
<!-- Back to Top -->
<a id="back-to-top" href="#" class="back-to-top"> <span
class="ti-angle-up"></span>
</a>
<!-- /Back to Top -->
<%@ include file="static/foot.jsp"%>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.ui.widget.js"></script>
<script
src="${pageContext.request.contextPath}/resources/js/jquery.form.js"></script>
<script>
<%@ include file="utils/menu.jsp"%>
<%@ include file="static/setMenu.js"%>
<%@ include file="utils/baseUrl.jsp"%>
var tableName = "";
var pageType = "pay";
function pay() {
updateId = window.sessionStorage.getItem('oId')
var tableName = window.sessionStorage.getItem('tableName')
$.ajax({
type: "POST",
url: baseUrl + tableName +"/update",
contentType: "application/json",
data:JSON.stringify({id: updateId, ispay: "已支付"}),
beforeSend: function(xhr) {xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));},
success: function(res){
if(res.code == 0){
window.sessionStorage.removeItem('id');
window.sessionStorage.removeItem('tableName');
alert('支付成功');
window.location.href= "modules/" + tableName +"/list.jsp";
}else if(res.code == 401){
<%@ include file="static/toLogin.jsp"%>
}else{
alert(res.msg)
}
},
});      
}
$(document).ready(function() {
//设置导航栏菜单
setMenu();
$('#submitBtn').on('click', function(e) {
e.preventDefault();
//console.log("点击了...提交按钮");
pay();
});
<%@ include file="static/myInfo.js"%>
});
// 用户登出
<%@ include file="static/logout.jsp"%>
</script>
</body>
</html>

@ -0,0 +1,26 @@
function crossBtnControl(btnName){
var role = window.sessionStorage.getItem('role');
for(var i=0;i<menus.length;i++){
// 找到当前登录角色的菜单
if(menus[i].roleName == role){
var menu = menus[i].backMenu;
for(var j=0;j<menu.length;j++){
// 一级菜单
var menuChild = menu[j].child;
var secondMenuName = "";
for(var k=0;k<menuChild.length;k++){
//定位到当前list页
if(menuChild[k].tableName == tableName && k == 0){
var allButtons = menuChild[k].buttons;
if(allButtons.includes(btnName)){
return true;
}else{
return false;
}
}
}
}
}
}
}

@ -0,0 +1,13 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- Jquery Library-->
<script src="${pageContext.request.contextPath}/resources/js/jquery-3.2.1.min.js"></script>
<!-- Popper Library-->
<script src="${pageContext.request.contextPath}/resources/js/popper.min.js"></script>
<!-- Bootstrap Library-->
<script src="${pageContext.request.contextPath}/resources/js/bootstrap.min.js"></script>
<!-- Datatable -->
<script src="${pageContext.request.contextPath}/resources/datatable/jquery.dataTables.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/datatable/dataTables.bootstrap4.min.js"></script>
<!-- Custom Script-->
<script src="${pageContext.request.contextPath}/resources/js/custom.js"></script>

@ -0,0 +1,41 @@
function getRoleButtons() {
var role = window.sessionStorage.getItem('role');
var allButtons = ["新增", "修改", "查看", "删除", "发布", "取件", "完成", "报表", "寄件", "接单", "发布订单"];
for (var i = 0; i < menus.length; i++) {
// 找到当前登录角色的菜单
if (menus[i].roleName == role) {
//后台菜单
var backMenu = menus[i].backMenu;
for (var j = 0; j < backMenu.length; j++) {
// 一级菜单
var menuChild = backMenu[j].child;
for (var k = 0; k < menuChild.length; k++) {
// 二级菜单
if (tableName == menuChild[k].tableName) {
var buttons = menuChild[k].buttons;
//console.log("you can see: "+buttons);
//将allButtons剔除能看到的按钮剩下的就是不能看到的按钮
if(buttons && buttons.length>0){
for(var l=0;l<buttons.length;l++){
if(allButtons.includes(buttons[l])){
var index = allButtons.indexOf(buttons[l]);
allButtons.splice(index,1);
//console.log("l="+l+","+allButtons);
}
}
}
//console.log("you can't see: "+allButtons);
for (var m=0; m<allButtons.length; m++) {
var elements = document.getElementsByClassName(allButtons[m]);
for (var n = elements.length - 1; n >= 0; n--) {
elements[n].parentNode.removeChild(elements[n]);
}
}
}
}
}
}
}
}

@ -0,0 +1,25 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>校园快递一站式服务系统</title>
<!-- Fav Icon Link -->
<link rel="shortcut icon" type="image/png" href="${pageContext.request.contextPath}/resources/images/fav.png">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/bootstrap.min.css">
<!-- themify icons CSS -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/themify-icons.css">
<!-- Animations CSS -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/animate.css">
<!-- Main CSS -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/styles.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/green.css" id="style_theme">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/responsive.css">
<!-- morris charts -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/charts/css/morris.css">
<!-- jvectormap -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/jquery-jvectormap.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/datatable/dataTables.bootstrap4.min.css">
<script src="${pageContext.request.contextPath}/resources/js/modernizr.min.js"></script>

@ -0,0 +1,32 @@
function iframeAuto() {
try {
if (window != parent) {
//定位需要调整的frame框架在父级窗口中查找
var a = parent.document.getElementsByTagName("iframe");
for (var i = 0; i < a.length; i++) {
if (a[i].contentWindow == window) {
var h1 = 0, h2 = 0;
a[i].parentNode.style.height = a[i].offsetHeight + "px";
a[i].style.height = "10px"; //首先设置高度为10px,后面会修改
if (document.documentElement && document.documentElement.scrollHeight) {
h1 = document.documentElement.scrollHeight;
}
if (document.body) h2 = document.body.scrollHeight;
var h = Math.max(h1, h2); //取两者中的较大值
if (document.all) { h += 4; }
if (window.opera) { h += 1; }
//调整框架的大小
a[i].style.height = a[i].parentNode.style.height = h + "px";
}
}
}
}
catch (ex) { }
}
//事件绑定的方法支持IE5以上版本
if (window.attachEvent) {
window.attachEvent("onload", iframeAuto);
}
else if (window.addEventListener) {
window.addEventListener('load', iframeAuto, false);
}

@ -0,0 +1,22 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
function logout() {
$.ajax({
type: "GET",
url: baseUrl + "users/logout",
beforeSend: function(xhr) {
xhr.setRequestHeader("token", window.sessionStorage.getItem('token'));
},
success: function(res){
if(res.code == 0 || res.code == 401){
window.sessionStorage.clear();
window.location.href="${pageContext.request.contextPath}/jsp/login.jsp"
}else{
alert(res.msg);
}
},
});
}
function toFront() {
window.location.assign(baseUrl+'front');
}

@ -0,0 +1,15 @@
//设置用户个人中心入口
if(window.sessionStorage.getItem('role') != '管理员'){
var accountTableName = window.sessionStorage.getItem('accountTableName');
$('#myinfo').attr('href','#');
$('#myinfo').on('click', function(e) {
e.preventDefault();
http(accountTableName+'/session','GET',{},(res)=>{
if(res.code == 0){
window.sessionStorage.setItem('userId',res.data.id);
window.sessionStorage.setItem('onlyme',true);
window.location.href = baseUrl + 'jsp/modules/' + accountTableName + '/add-or-update.jsp';
}
});
});
}

@ -0,0 +1,51 @@
function setMenu(){
if(window.sessionStorage.getItem('role') != '管理员'){
var accountTableName = window.sessionStorage.getItem('accountTableName');
$('#side-menu').append('<li><a href="javascript:void(0);" data-toggle="collapse" data-target="#app_dr"><div class="pull-left"><i class="zmdi zmdi-apps mr-20"></i><span class="right-nav-text">个人中心</span></div><div class="pull-right"><i class="zmdi zmdi-caret-down"></i></div><div class="clearfix"></div></a><ul id="app_dr" class="collapse collapse-level-1"><li><a href="' + baseUrl + 'jsp/modules/center/updatePassword.jsp" onclick="navClick(this);return false;">修改密码</a></li><li><a href="${pageContext.request.contextPath}/jsp/modules/' + accountTableName + '/add-or-update.jsp" onclick="navClick(this);return false;">个人信息</a></li></ul></li>');
http(accountTableName+'/session','GET',{},(res)=>{
if(res.code == 0){
window.sessionStorage.setItem('userId',res.data.id);
window.sessionStorage.setItem('onlyme',true);
}
});
} else {
$('#side-menu').append('<li><a href="javascript:void(0);" data-toggle="collapse" data-target="#app_dr"><div class="pull-left"><i class="zmdi zmdi-apps mr-20"></i><span class="right-nav-text">个人中心</span></div><div class="pull-right"><i class="zmdi zmdi-caret-down"></i></div><div class="clearfix"></div></a><ul id="app_dr" class="collapse collapse-level-1"><li><a href="' + baseUrl + 'jsp/modules/center/updatePassword.jsp" onclick="navClick(this);return false;">修改密码</a></li><li><a href="' + baseUrl + 'jsp/modules/center/info.jsp" onclick="navClick(this);return false;">个人信息</a></li></ul></li>');
}
var role = window.sessionStorage.getItem('role');
var menusHtml = '';
for(var i=0;i<menus.length;i++){
// 找到当前登录角色的菜单
if(menus[i].roleName == role){
var menuHtml = '';
var menu = menus[i].backMenu;
for(var j=0;j<menu.length;j++){
// 一级菜单
menuHtml += '<li><a href="javascript:void(0);" data-toggle="collapse" data-target="#app_m' + j + '"><div class="pull-left"><i class="zmdi zmdi-apps mr-20"></i><span class="right-nav-text">' + menu[j].menu + '</span></div><div class="pull-right"><i class="zmdi zmdi-caret-down"></i></div><div class="clearfix"></div></a><ul id="app_m' + j + '" class="collapse collapse-level-1">';
var menuSubHtml = '';
var secondMenuName = "";
var menuChild = menu[j].child;
for(var k=0;k<menuChild.length;k++){
// 二级菜单
if(secondMenuName == menuChild[k].tableName && secondMenuName != ""){
menuSubHtml += '<li><a href="${pageContext.request.contextPath}/jsp/modules/' + menuChild[k].tableName + '/graph.jsp" onclick="navClick(this);return false;">' + menuChild[k].menu + '</a></li>';
}else{
menuSubHtml += '<li><a href="${pageContext.request.contextPath}/jsp/modules/' + menuChild[k].tableName + '/list.jsp" onclick="navClick(this);return false;">' + menuChild[k].menu + '</a></li>';
secondMenuName = menuChild[k].tableName;
}
}
menuHtml += menuSubHtml + '</ul></li>';
}
menusHtml += menuHtml;
}
}
$('#side-menu').append(menusHtml);
if(hasMessage != null && hasMessage == '是' && role == '管理员'){
$('#side-menu').append('<li><a href="javascript:void(0);" data-toggle="collapse" data-target="#app_dr1"><div class="pull-left"><i class="zmdi zmdi-apps mr-20"></i><span class="right-nav-text">留言管理</span></div><div class="pull-right"><i class="zmdi zmdi-caret-down"></i></div><div class="clearfix"></div></a><ul id="app_dr1" class="collapse collapse-level-1"><li><a href="' + baseUrl + 'jsp/modules/messages/list.jsp" onclick="navClick(this);return false;">留言列表</a></li></ul></li>');
}
}
window.navClick = function(obj, rootNavName, subNavName) {
$('iframe').attr('src', obj.href);
}

@ -0,0 +1,5 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- token过期或未登录时强制跳转到登录页 -->
alert('token过期或未登录!')
window.location.href="${pageContext.request.contextPath}/jsp/login.jsp"

@ -0,0 +1,69 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
var baseUrl = "http://localhost:8080/kuaidizhan/";
var projectName = "校园快递一站式服务系统"
/**
* 网络请求
* @param {Object} url 地址
* @param {Object} method get/post
* @param {Object} param 参数
* @param {Object} callback 回调函数
*/
function http(url, type, data, callback) {
url = baseUrl + url;
$.ajax({
url: url,
beforeSend: function(request) {
request.setRequestHeader("token", window.sessionStorage.getItem("token"));
},
contentType: 'application/x-www-form-urlencoded',
data: data,
dataType: 'json',
type: type,
async: false,
success: function(result, status, xhr) {
if (result.code == 0) {
callback(result);
} else if (result.code == 401) {
window.location.href = '${pageContext.request.contextPath}/jsp/login.jsp';
} else {
alert(result.msg)
}
},
error: function(xhr, status, error) {
console.log(xhr, status, error)
}
});
}
function httpJson(url, type, data, callback) {
url = baseUrl + url;
var params = null;
if (data) {
var params = JSON.stringify(data);
}
$.ajax({
url: url,
beforeSend: function(request) {
request.setRequestHeader("token", window.sessionStorage.getItem("token"));
},
contentType: 'application/json',
data: params,
dataType: 'json',
type: type,
async: false,
success: function(result, status, xhr) {
if (result.code == 0) {
callback(result);
} else if (result.code == 401) {
window.location.href = '${pageContext.request.contextPath}/jsp/login.jsp';
} else {
alert(result.msg)
}
},
error: function(xhr, status, error) {
console.log(xhr, status, error)
}
});
}

@ -0,0 +1,219 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
var menus = [
{
"backMenu":[
{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除",
],
"menu":"用户管理",
"menuJump":"列表",
"tableName":"yonghu"
}
],
"menu":"用户管理"
}
,{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除",
],
"menu":"代取人管理",
"menuJump":"列表",
"tableName":"daiquren"
}
],
"menu":"代取人管理"
},
{
"child":[
{
"buttons":[
"查看",
"新增",
"修改",
"删除",
],
"menu":"快递站点管理",
"menuJump":"列表",
"tableName":"zhandian"
}
],
"menu":"快递站点管理"
},
{
"child":[
{
"buttons":[
"新增",
"修改",
"删除",
],
"menu":"待取件表管理",
"menuJump":"列表",
"tableName":"daiqu"
}
],
"menu":"待取件表管理"
}
,{
"child":[
{
"buttons":[
"新增",
"删除",
],
"menu":"快递接单表管理",
"menuJump":"列表",
"tableName":"jiedan"
}
],
"menu":"快递接单表管理"
}
,{
"child":[
{
"buttons":[
"查看",
"删除",
],
"menu":"已接单表管理",
"menuJump":"列表",
"tableName":"yijiedan"
}
],
"menu":"已接单表管理"
}
],
"frontMenu":[
],
"roleName":"管理员",
"tableName":"users"
},
{
"backMenu":[
{
"child":[
{
"buttons":[
"查看",
],
"menu":"快递站点管理",
"menuJump":"列表",
"tableName":"zhandian"
}
],
"menu":"快递站点管理"
},
{
"child":[
{
"buttons":[
"接单",
],
"menu":"快递接单表管理",
"menuJump":"列表",
"tableName":"jiedan"
}
],
"menu":"快递接单表管理"
}
,{
"child":[
{
"buttons":[
"查看",
],
"menu":"已接单表管理",
"menuJump":"列表",
"tableName":"yijiedan"
}
],
"menu":"已接单表管理"
}
],
"frontMenu":[
],
"roleName":"代取人",
"tableName":"daiquren"
},
{
"backMenu":[
{
"child":[
{
"buttons":[
"查看",
],
"menu":"快递站点管理",
"menuJump":"列表",
"tableName":"zhandian"
}
],
"menu":"快递站点管理"
},
{
"child":[
{
"buttons":[
"取件",
"发布订单",
],
"menu":"待取件表管理",
"menuJump":"列表",
"tableName":"daiqu"
}
],
"menu":"待取件表管理"
}
,{
"child":[
{
"buttons":[
"寄件",
],
"menu":"快递接单表管理",
"menuJump":"列表",
"tableName":"jiedan"
}
],
"menu":"快递接单表管理"
}
,{
"child":[
{
"buttons":[
"查看",
"完成",
],
"menu":"已接单表管理",
"menuJump":"列表",
"tableName":"yijiedan"
}
],
"menu":"已接单表管理"
}
],
"frontMenu":[
],
"roleName":"用户",
"tableName":"yonghu"
}
];
var hasMessage = '';

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,14 @@
var $lang={
errAlertMsg: "Invalid date or the date out of range,redo or not?",
aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],
aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"],
clearStr: "Clear",
todayStr: "Today",
okStr: "OK",
updateStr: "OK",
timeStr: "Time",
quickStr: "Quick Selection",
err_1: 'MinDate Cannot be bigger than MaxDate!'
}

@ -0,0 +1,14 @@
var $lang={
errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u8303\u56F4,\u9700\u8981\u64A4\u9500\u5417?",
aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],
aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],
aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"],
aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],
clearStr: "\u6E05\u7A7A",
todayStr: "\u4ECA\u5929",
okStr: "\u786E\u5B9A",
updateStr: "\u786E\u5B9A",
timeStr: "\u65F6\u95F4",
quickStr: "\u5FEB\u901F\u9009\u62E9",
err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u4E8E\u6700\u5927\u65E5\u671F!'
}

@ -0,0 +1,14 @@
var $lang={
errAlertMsg: "\u4E0D\u5408\u6CD5\u7684\u65E5\u671F\u683C\u5F0F\u6216\u8005\u65E5\u671F\u8D85\u51FA\u9650\u5B9A\u7BC4\u570D,\u9700\u8981\u64A4\u92B7\u55CE?",
aWeekStr: ["\u5468","\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"],
aLongWeekStr:["\u5468","\u661F\u671F\u65E5","\u661F\u671F\u4E00","\u661F\u671F\u4E8C","\u661F\u671F\u4E09","\u661F\u671F\u56DB","\u661F\u671F\u4E94","\u661F\u671F\u516D"],
aMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00","\u5341\u4E8C"],
aLongMonStr: ["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"],
clearStr: "\u6E05\u7A7A",
todayStr: "\u4ECA\u5929",
okStr: "\u78BA\u5B9A",
updateStr: "\u78BA\u5B9A",
timeStr: "\u6642\u9593",
quickStr: "\u5FEB\u901F\u9078\u64C7",
err_1: '\u6700\u5C0F\u65E5\u671F\u4E0D\u80FD\u5927\u65BC\u6700\u5927\u65E5\u671F!'
}

@ -0,0 +1,11 @@
.Wdate{
border:#999 1px solid;
height:20px;
background:#fff url(datePicker.gif) no-repeat right;
}
.Wdate::-ms-clear{display:none;}
.WdateFmtErr{
font-weight:bold;
color:red;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -0,0 +1,246 @@
/*
* My97 DatePicker 4.8
*/
.WdateDiv{
width:180px;
background-color:#FFFFFF;
border:#bbb 1px solid;
padding:2px;
}
.WdateDiv2{
width:360px;
}
.WdateDiv *{font-size:9pt;}
.WdateDiv .NavImg a{
display:block;
cursor:pointer;
height:16px;
width:16px;
}
.WdateDiv .NavImgll a{
float:left;
background:transparent url(img.gif) no-repeat scroll 0 0;
}
.WdateDiv .NavImgl a{
float:left;
background:transparent url(img.gif) no-repeat scroll -16px 0;
}
.WdateDiv .NavImgr a{
float:right;
background:transparent url(img.gif) no-repeat scroll -32px 0;
}
.WdateDiv .NavImgrr a{
float:right;
background:transparent url(img.gif) no-repeat scroll -48px 0;
}
.WdateDiv #dpTitle{
height:24px;
margin-bottom:2px;
padding:1px;
}
.WdateDiv .yminput{
margin-top:2px;
text-align:center;
height:20px;
border:0px;
width:50px;
cursor:pointer;
}
.WdateDiv .yminputfocus{
margin-top:2px;
text-align:center;
font-weight:bold;
height:20px;
color:blue;
border:#ccc 1px solid;
width:50px;
}
.WdateDiv .menuSel{
z-index:1;
position:absolute;
background-color:#FFFFFF;
border:#ccc 1px solid;
display:none;
}
.WdateDiv .menu{
cursor:pointer;
background-color:#fff;
}
.WdateDiv .menuOn{
cursor:pointer;
background-color:#BEEBEE;
}
.WdateDiv .invalidMenu{
color:#aaa;
}
.WdateDiv .YMenu{
margin-top:20px;
}
.WdateDiv .MMenu{
margin-top:20px;
*width:62px;
}
.WdateDiv .hhMenu{
margin-top:-90px;
margin-left:26px;
}
.WdateDiv .mmMenu{
margin-top:-46px;
margin-left:26px;
}
.WdateDiv .ssMenu{
margin-top:-24px;
margin-left:26px;
}
.WdateDiv .Wweek {
text-align:center;
background:#DAF3F5;
border-right:#BDEBEE 1px solid;
}
.WdateDiv .MTitle{
background-color:#BDEBEE;
}
.WdateDiv .WdayTable2{
border-collapse:collapse;
border:#c5d9e8 1px solid;
}
.WdateDiv .WdayTable2 table{
border:0;
}
.WdateDiv .WdayTable{
line-height:20px;
border:#c5d9e8 1px solid;
}
.WdateDiv .WdayTable td{
text-align:center;
}
.WdateDiv .Wday{
cursor:pointer;
}
.WdateDiv .WdayOn{
cursor:pointer;
background-color:#C0EBEF;
}
.WdateDiv .Wwday{
cursor:pointer;
color:#FF2F2F;
}
.WdateDiv .WwdayOn{
cursor:pointer;
color:#000;
background-color:#C0EBEF;
}
.WdateDiv .Wtoday{
cursor:pointer;
color:blue;
}
.WdateDiv .Wselday{
background-color:#A9E4E9;
}
.WdateDiv .WspecialDay{
background-color:#66F4DF;
}
.WdateDiv .WotherDay{
cursor:pointer;
color:#6A6AFF;
}
.WdateDiv .WotherDayOn{
cursor:pointer;
background-color:#C0EBEF;
}
.WdateDiv .WinvalidDay{
color:#aaa;
}
.WdateDiv #dpTime{
float:left;
margin-top:3px;
margin-right:30px;
}
.WdateDiv #dpTime #dpTimeStr{
margin-left:1px;
}
.WdateDiv #dpTime input{
width:18px;
height:20px;
text-align:center;
border:#ccc 1px solid;
}
.WdateDiv #dpTime .tB{
border-right:0px;
}
.WdateDiv #dpTime .tE{
border-left:0;
border-right:0;
}
.WdateDiv #dpTime .tm{
width:7px;
border-left:0;
border-right:0;
}
.WdateDiv #dpTime #dpTimeUp{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -32px -16px;
}
.WdateDiv #dpTime #dpTimeDown{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -48px -16px;
}
.WdateDiv #dpQS {
float:left;
margin-right:3px;
margin-top:3px;
background:url(img.gif) no-repeat 0px -16px;
width:20px;
height:20px;
cursor:pointer;
}
.WdateDiv #dpControl {
text-align:right;
}
.WdateDiv .dpButton{
height:20px;
width:45px;
border:#ccc 1px solid;
margin-top:2px;
margin-right:1px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

@ -0,0 +1,256 @@
/*
* My97 DatePicker 4.8 Skin:whyGreen
*/
.WdateDiv{
width:180px;
background-color:#fff;
border:#C5E1E4 1px solid;
padding:2px;
}
.WdateDiv2{
width:360px;
}
.WdateDiv *{font-size:9pt;}
.WdateDiv .NavImg a{
cursor:pointer;
display:block;
width:16px;
height:16px;
margin-top:1px;
}
.WdateDiv .NavImgll a{
float:left;
background:url(img.gif) no-repeat;
}
.WdateDiv .NavImgl a{
float:left;
background:url(img.gif) no-repeat -16px 0px;
}
.WdateDiv .NavImgr a{
float:right;
background:url(img.gif) no-repeat -32px 0px;
}
.WdateDiv .NavImgrr a{
float:right;
background:url(img.gif) no-repeat -48px 0px;
}
.WdateDiv #dpTitle{
height:24px;
padding:1px;
border:#c5d9e8 1px solid;
background:url(bg.jpg);
margin-bottom:2px;
}
.WdateDiv .yminput{
margin-top:2px;
text-align:center;
border:0px;
height:20px;
width:50px;
color:#034c50;
background-color:transparent;
cursor:pointer;
}
.WdateDiv .yminputfocus{
margin-top:2px;
text-align:center;
border:#939393 1px solid;
font-weight:bold;
color:#034c50;
height:20px;
width:50px;
}
.WdateDiv .menuSel{
z-index:1;
position:absolute;
background-color:#FFFFFF;
border:#A3C6C8 1px solid;
display:none;
}
.WdateDiv .menu{
cursor:pointer;
background-color:#fff;
color:#11777C;
}
.WdateDiv .menuOn{
cursor:pointer;
background-color:#BEEBEE;
}
.WdateDiv .invalidMenu{
color:#aaa;
}
.WdateDiv .YMenu{
margin-top:20px;
}
.WdateDiv .MMenu{
margin-top:20px;
*width:62px;
}
.WdateDiv .hhMenu{
margin-top:-90px;
margin-left:26px;
}
.WdateDiv .mmMenu{
margin-top:-46px;
margin-left:26px;
}
.WdateDiv .ssMenu{
margin-top:-24px;
margin-left:26px;
}
.WdateDiv .Wweek {
text-align:center;
background:#DAF3F5;
border-right:#BDEBEE 1px solid;
}
.WdateDiv .MTitle{
color:#13777e;
background-color:#bdebee;
}
.WdateDiv .WdayTable2{
border-collapse:collapse;
border:#BEE9F0 1px solid;
}
.WdateDiv .WdayTable2 table{
border:0;
}
.WdateDiv .WdayTable{
line-height:20px;
color:#13777e;
background-color:#edfbfb;
border:#BEE9F0 1px solid;
}
.WdateDiv .WdayTable td{
text-align:center;
}
.WdateDiv .Wday{
cursor:pointer;
}
.WdateDiv .WdayOn{
cursor:pointer;
background-color:#74d2d9 ;
}
.WdateDiv .Wwday{
cursor:pointer;
color:#ab1e1e;
}
.WdateDiv .WwdayOn{
cursor:pointer;
background-color:#74d2d9;
}
.WdateDiv .Wtoday{
cursor:pointer;
color:blue;
}
.WdateDiv .Wselday{
background-color:#A7E2E7;
}
.WdateDiv .WspecialDay{
background-color:#66F4DF;
}
.WdateDiv .WotherDay{
cursor:pointer;
color:#0099CC;
}
.WdateDiv .WotherDayOn{
cursor:pointer;
background-color:#C0EBEF;
}
.WdateDiv .WinvalidDay{
color:#aaa;
}
.WdateDiv #dpTime{
float:left;
margin-top:3px;
margin-right:30px;
}
.WdateDiv #dpTime #dpTimeStr{
margin-left:1px;
color:#497F7F;
}
.WdateDiv #dpTime input{
height:20px;
width:18px;
text-align:center;
color:#333;
border:#61CAD0 1px solid;
}
.WdateDiv #dpTime .tB{
border-right:0px;
}
.WdateDiv #dpTime .tE{
border-left:0;
border-right:0;
}
.WdateDiv #dpTime .tm{
width:7px;
border-left:0;
border-right:0;
}
.WdateDiv #dpTime #dpTimeUp{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -32px -16px;
}
.WdateDiv #dpTime #dpTimeDown{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -48px -16px;
}
.WdateDiv #dpQS {
float:left;
margin-right:3px;
margin-top:3px;
background:url(img.gif) no-repeat 0px -16px;
width:20px;
height:20px;
cursor:pointer;
}
.WdateDiv #dpControl {
text-align:right;
margin-top:3px;
}
.WdateDiv .dpButton{
height:20px;
width:45px;
margin-top:2px;
border:#38B1B9 1px solid;
background-color:#CFEBEE;
color:#08575B;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1,14 @@
var $lang={
errAlertMsg: "Invalid date or the date out of range,redo or not?",
aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
aLongWeekStr:["wk","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],
aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
aLongMonStr: ["January","February","March","April","May","June","July","August","September","October","November","December"],
clearStr: "Clear",
todayStr: "Today",
okStr: "OK",
updateStr: "OK",
timeStr: "Time",
quickStr: "Quick Selection",
err_1: 'MinDate Cannot be bigger than MaxDate!'
}

@ -0,0 +1,14 @@
var $lang={
errAlertMsg: "不合法的日期格式或者日期超出限定范围,需要撤销吗?",
aWeekStr: ["周","日","一","二","三","四","五","六"],
aLongWeekStr:["周","星期日","星期一","星期二","星期三","星期四","星期五","星期六"],
aMonStr: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一","十二"],
aLongMonStr: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
clearStr: "清空",
todayStr: "今天",
okStr: "确定",
updateStr: "确定",
timeStr: "时间",
quickStr: "快速选择",
err_1: '最小日期不能大于最大日期!'
}

@ -0,0 +1,14 @@
var $lang={
errAlertMsg: "不合法的日期格式或者日期超出限定範圍,需要撤銷嗎?",
aWeekStr: ["周","日","一","二","三","四","五","六"],
aLongWeekStr:["周","星期日","星期一","星期二","星期三","星期四","星期五","星期六"],
aMonStr: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一","十二"],
aLongMonStr: ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],
clearStr: "清空",
todayStr: "今天",
okStr: "確定",
updateStr: "確定",
timeStr: "時間",
quickStr: "快速選擇",
err_1: '最小日期不能大於最大日期!'
}

@ -0,0 +1,3 @@
正式发布时,可将此文件夹删去

@ -0,0 +1,11 @@
.Wdate{
border:#999 1px solid;
height:20px;
background:#fff url(datePicker.gif) no-repeat right;
}
.Wdate::-ms-clear{display:none;}
.WdateFmtErr{
font-weight:bold;
color:red;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -0,0 +1,267 @@
/*
* My97 DatePicker 4.8
* :default
*/
/* 日期选择容器 DIV */
.WdateDiv{
width:180px;
background-color:#FFFFFF;
border:#bbb 1px solid;
padding:2px;
}
/* 双月日历的宽度 */
.WdateDiv2{
width:360px;
}
.WdateDiv *{font-size:9pt;}
/****************************
* A
***************************/
.WdateDiv .NavImg a{
display:block;
cursor:pointer;
height:16px;
width:16px;
}
.WdateDiv .NavImgll a{
float:left;
background:transparent url(img.gif) no-repeat scroll 0 0;
}
.WdateDiv .NavImgl a{
float:left;
background:transparent url(img.gif) no-repeat scroll -16px 0;
}
.WdateDiv .NavImgr a{
float:right;
background:transparent url(img.gif) no-repeat scroll -32px 0;
}
.WdateDiv .NavImgrr a{
float:right;
background:transparent url(img.gif) no-repeat scroll -48px 0;
}
/****************************
*
***************************/
/* 年份月份栏 DIV */
.WdateDiv #dpTitle{
height:24px;
margin-bottom:2px;
padding:1px;
}
/* 年份月份输入框 INPUT */
.WdateDiv .yminput{
margin-top:2px;
text-align:center;
height:20px;
border:0px;
width:50px;
cursor:pointer;
}
/* 年份月份输入框获得焦点时的样式 INPUT */
.WdateDiv .yminputfocus{
margin-top:2px;
text-align:center;
font-weight:bold;
height:20px;
color:blue;
border:#ccc 1px solid;
width:50px;
}
/* 菜单选择框 DIV */
.WdateDiv .menuSel{
z-index:1;
position:absolute;
background-color:#FFFFFF;
border:#ccc 1px solid;
display:none;
}
/* 菜单的样式 TD */
.WdateDiv .menu{
cursor:pointer;
background-color:#fff;
}
/* 菜单的mouseover样式 TD */
.WdateDiv .menuOn{
cursor:pointer;
background-color:#BEEBEE;
}
/* 菜单无效时的样式 TD */
.WdateDiv .invalidMenu{
color:#aaa;
}
/* 年选择框的偏移 DIV */
.WdateDiv .YMenu{
margin-top:20px;
}
/* 月选择框的偏移 DIV */
.WdateDiv .MMenu{
margin-top:20px;
*width:62px;
}
/* 时选择框的位置 DIV */
.WdateDiv .hhMenu{
margin-top:-90px;
margin-left:26px;
}
/* 分选择框的位置 DIV */
.WdateDiv .mmMenu{
margin-top:-46px;
margin-left:26px;
}
/* 秒选择框的位置 DIV */
.WdateDiv .ssMenu{
margin-top:-24px;
margin-left:26px;
}
/****************************
*
***************************/
.WdateDiv .Wweek {
text-align:center;
background:#DAF3F5;
border-right:#BDEBEE 1px solid;
}
/****************************
* ,
***************************/
/* 星期栏 TR */
.WdateDiv .MTitle{
background-color:#BDEBEE;
}
.WdateDiv .WdayTable2{
border-collapse:collapse;
border:#c5d9e8 1px solid;
}
.WdateDiv .WdayTable2 table{
border:0;
}
/* 日期栏表格 TABLE */
.WdateDiv .WdayTable{
line-height:20px;
border:#c5d9e8 1px solid;
}
.WdateDiv .WdayTable td{
text-align:center;
}
/* 日期格的样式 TD */
.WdateDiv .Wday{
cursor:pointer;
}
/* 日期格的mouseover样式 TD */
.WdateDiv .WdayOn{
cursor:pointer;
background-color:#C0EBEF;
}
/* 周末日期格的样式 TD */
.WdateDiv .Wwday{
cursor:pointer;
color:#FF2F2F;
}
/* 周末日期格的mouseover样式 TD */
.WdateDiv .WwdayOn{
cursor:pointer;
color:#000;
background-color:#C0EBEF;
}
.WdateDiv .Wtoday{
cursor:pointer;
color:blue;
}
.WdateDiv .Wselday{
background-color:#A9E4E9;
}
.WdateDiv .WspecialDay{
background-color:#66F4DF;
}
/* 其他月份的日期 */
.WdateDiv .WotherDay{
cursor:pointer;
color:#6A6AFF;
}
/* 其他月份的日期mouseover样式 */
.WdateDiv .WotherDayOn{
cursor:pointer;
background-color:#C0EBEF;
}
/* 无效日期的样式,即在日期范围以外日期格的样式,不能选择的日期 */
.WdateDiv .WinvalidDay{
color:#aaa;
}
/****************************
*
***************************/
/* 时间栏 DIV */
.WdateDiv #dpTime{
float:left;
margin-top:3px;
margin-right:30px;
}
/* 时间文字 SPAN */
.WdateDiv #dpTime #dpTimeStr{
margin-left:1px;
}
/* 时间输入框 INPUT */
.WdateDiv #dpTime input{
width:18px;
height:20px;
text-align:center;
border:#ccc 1px solid;
}
/* 时间 时 INPUT */
.WdateDiv #dpTime .tB{
border-right:0px;
}
/* 时间 分和间隔符 ':' INPUT */
.WdateDiv #dpTime .tE{
border-left:0;
border-right:0;
}
/* 时间 秒 INPUT */
.WdateDiv #dpTime .tm{
width:7px;
border-left:0;
border-right:0;
}
/* 时间右边的向上按钮 BUTTON */
.WdateDiv #dpTime #dpTimeUp{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -32px -16px;
}
/* 时间右边的向下按钮 BUTTON */
.WdateDiv #dpTime #dpTimeDown{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -48px -16px;
}
/****************************
*
***************************/
.WdateDiv #dpQS {
float:left;
margin-right:3px;
margin-top:3px;
background:url(img.gif) no-repeat 0px -16px;
width:20px;
height:20px;
cursor:pointer;
}
.WdateDiv #dpControl {
text-align:right;
}
.WdateDiv .dpButton{
height:20px;
width:45px;
border:#ccc 1px solid;
margin-top:2px;
margin-right:1px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 B

@ -0,0 +1,277 @@
/*
* My97 DatePicker 4.8
* :whyGreen
*/
/* 日期选择容器 DIV */
.WdateDiv{
width:180px;
background-color:#fff;
border:#C5E1E4 1px solid;
padding:2px;
}
/* 双月日历的宽度 */
.WdateDiv2{
width:360px;
}
.WdateDiv *{font-size:9pt;}
/****************************
* A
***************************/
.WdateDiv .NavImg a{
cursor:pointer;
display:block;
width:16px;
height:16px;
margin-top:1px;
}
.WdateDiv .NavImgll a{
float:left;
background:url(img.gif) no-repeat;
}
.WdateDiv .NavImgl a{
float:left;
background:url(img.gif) no-repeat -16px 0px;
}
.WdateDiv .NavImgr a{
float:right;
background:url(img.gif) no-repeat -32px 0px;
}
.WdateDiv .NavImgrr a{
float:right;
background:url(img.gif) no-repeat -48px 0px;
}
/****************************
*
***************************/
/* 年份月份栏 DIV */
.WdateDiv #dpTitle{
height:24px;
padding:1px;
border:#c5d9e8 1px solid;
background:url(bg.jpg);
margin-bottom:2px;
}
/* 年份月份输入框 INPUT */
.WdateDiv .yminput{
margin-top:2px;
text-align:center;
border:0px;
height:20px;
width:50px;
color:#034c50;
background-color:transparent;
cursor:pointer;
}
/* 年份月份输入框获得焦点时的样式 INPUT */
.WdateDiv .yminputfocus{
margin-top:2px;
text-align:center;
border:#939393 1px solid;
font-weight:bold;
color:#034c50;
height:20px;
width:50px;
}
/* 菜单选择框 DIV */
.WdateDiv .menuSel{
z-index:1;
position:absolute;
background-color:#FFFFFF;
border:#A3C6C8 1px solid;
display:none;
}
/* 菜单的样式 TD */
.WdateDiv .menu{
cursor:pointer;
background-color:#fff;
color:#11777C;
}
/* 菜单的mouseover样式 TD */
.WdateDiv .menuOn{
cursor:pointer;
background-color:#BEEBEE;
}
/* 菜单无效时的样式 TD */
.WdateDiv .invalidMenu{
color:#aaa;
}
/* 年选择框的偏移 DIV */
.WdateDiv .YMenu{
margin-top:20px;
}
/* 月选择框的偏移 DIV */
.WdateDiv .MMenu{
margin-top:20px;
*width:62px;
}
/* 时选择框的位置 DIV */
.WdateDiv .hhMenu{
margin-top:-90px;
margin-left:26px;
}
/* 分选择框的位置 DIV */
.WdateDiv .mmMenu{
margin-top:-46px;
margin-left:26px;
}
/* 秒选择框的位置 DIV */
.WdateDiv .ssMenu{
margin-top:-24px;
margin-left:26px;
}
/****************************
*
***************************/
.WdateDiv .Wweek {
text-align:center;
background:#DAF3F5;
border-right:#BDEBEE 1px solid;
}
/****************************
* ,
***************************/
/* 星期栏 TR */
.WdateDiv .MTitle{
color:#13777e;
background-color:#bdebee;
}
.WdateDiv .WdayTable2{
border-collapse:collapse;
border:#BEE9F0 1px solid;
}
.WdateDiv .WdayTable2 table{
border:0;
}
/* 日期栏表格 TABLE */
.WdateDiv .WdayTable{
line-height:20px;
color:#13777e;
background-color:#edfbfb;
border:#BEE9F0 1px solid;
}
.WdateDiv .WdayTable td{
text-align:center;
}
/* 日期格的样式 TD */
.WdateDiv .Wday{
cursor:pointer;
}
/* 日期格的mouseover样式 TD */
.WdateDiv .WdayOn{
cursor:pointer;
background-color:#74d2d9 ;
}
/* 周末日期格的样式 TD */
.WdateDiv .Wwday{
cursor:pointer;
color:#ab1e1e;
}
/* 周末日期格的mouseover样式 TD */
.WdateDiv .WwdayOn{
cursor:pointer;
background-color:#74d2d9;
}
.WdateDiv .Wtoday{
cursor:pointer;
color:blue;
}
.WdateDiv .Wselday{
background-color:#A7E2E7;
}
.WdateDiv .WspecialDay{
background-color:#66F4DF;
}
/* 其他月份的日期 */
.WdateDiv .WotherDay{
cursor:pointer;
color:#0099CC;
}
/* 其他月份的日期mouseover样式 */
.WdateDiv .WotherDayOn{
cursor:pointer;
background-color:#C0EBEF;
}
/* 无效日期的样式,即在日期范围以外日期格的样式,不能选择的日期 */
.WdateDiv .WinvalidDay{
color:#aaa;
}
/****************************
*
***************************/
/* 时间栏 DIV */
.WdateDiv #dpTime{
float:left;
margin-top:3px;
margin-right:30px;
}
/* 时间文字 SPAN */
.WdateDiv #dpTime #dpTimeStr{
margin-left:1px;
color:#497F7F;
}
/* 时间输入框 INPUT */
.WdateDiv #dpTime input{
height:20px;
width:18px;
text-align:center;
color:#333;
border:#61CAD0 1px solid;
}
/* 时间 时 INPUT */
.WdateDiv #dpTime .tB{
border-right:0px;
}
/* 时间 分和间隔符 ':' INPUT */
.WdateDiv #dpTime .tE{
border-left:0;
border-right:0;
}
/* 时间 秒 INPUT */
.WdateDiv #dpTime .tm{
width:7px;
border-left:0;
border-right:0;
}
/* 时间右边的向上按钮 BUTTON */
.WdateDiv #dpTime #dpTimeUp{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -32px -16px;
}
/* 时间右边的向下按钮 BUTTON */
.WdateDiv #dpTime #dpTimeDown{
height:10px;
width:13px;
border:0px;
background:url(img.gif) no-repeat -48px -16px;
}
/****************************
*
***************************/
.WdateDiv #dpQS {
float:left;
margin-right:3px;
margin-top:3px;
background:url(img.gif) no-repeat 0px -16px;
width:20px;
height:20px;
cursor:pointer;
}
.WdateDiv #dpControl {
text-align:right;
margin-top:3px;
}
.WdateDiv .dpButton{
height:20px;
width:45px;
margin-top:2px;
border:#38B1B9 1px solid;
background-color:#CFEBEE;
color:#08575B;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save