整理数据字典,优化代码
diff --git a/src/main/java/com/supwisdom/dlpay/framework/util/Dictionary.java b/src/main/java/com/supwisdom/dlpay/framework/util/Dictionary.java
index af7b9e2..46377e9 100644
--- a/src/main/java/com/supwisdom/dlpay/framework/util/Dictionary.java
+++ b/src/main/java/com/supwisdom/dlpay/framework/util/Dictionary.java
@@ -4,6 +4,9 @@
// dictionary 表字典
public static final String REVERSE_FLAG = "reverseflagList";
public static final String DTL_STATUS = "dtlStatusList";
+ public static final String IDTYPE = "idtypeList";
+ public static final String SEX = "sexList";
+ public static final String ACCOUNT_STATUS = "accountStatusList";
/////////////////////////////////////
public static final String SOURCE_TYPE = "sourcetypeList";
diff --git a/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java b/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
index a39aa52..31c7fae 100644
--- a/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
+++ b/src/main/java/com/supwisdom/dlpay/system/controller/UserController.java
@@ -6,11 +6,13 @@
import com.supwisdom.dlpay.api.domain.TPersonIdentity;
import com.supwisdom.dlpay.api.domain.TPointsAccount;
import com.supwisdom.dlpay.framework.domain.TOperator;
+import com.supwisdom.dlpay.framework.util.Dictionary;
import com.supwisdom.dlpay.framework.util.PageResult;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.framework.util.WebConstant;
import com.supwisdom.dlpay.system.bean.IdTypeBean;
import com.supwisdom.dlpay.system.bean.PersonParamBean;
+import com.supwisdom.dlpay.system.service.DictionaryProxy;
import com.supwisdom.dlpay.system.service.UserDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -23,142 +25,140 @@
@Controller
public class UserController {
- @Autowired
- private UserDataService userDataService;
+ @Autowired
+ private UserDataService userDataService;
- @GetMapping("/user/index")
- public String index() {
- return "system/user/index";
- }
+ @Autowired
+ private DictionaryProxy dictionaryProxy;
- @GetMapping("/user/list")
- @PreAuthorize("hasPermission('/user/list','')")
- @ResponseBody
- public PageResult<TPerson> getDataList(@RequestParam("page") Integer pageNo,
- @RequestParam("limit") Integer pageSize,
- @RequestParam(value = "searchkey", required = false) String searchKey) {
- try {
- if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
- if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
- PersonParamBean searchBean = new PersonParamBean();
- searchBean.setPageNo(pageNo);
- searchBean.setName(searchKey);
- searchBean.setPageSize(pageSize);
- return userDataService.getPersonsByKey(searchBean);
- } catch (Exception e) {
- e.printStackTrace();
- return new PageResult<>(99, "系统查询错误");
- }
- }
+ @GetMapping("/user/index")
+ public String index() {
+ return "system/user/index";
+ }
- @GetMapping("/user/loadadd")
- public String add(ModelMap map) {
- List<IdTypeBean> list = new ArrayList<>();
- list.add(new IdTypeBean("1", "身份证"));
- list.add(new IdTypeBean("2", "护照"));
- list.add(new IdTypeBean("3", "驾照"));
- list.add(new IdTypeBean("4", "港澳通行证"));
- list.add(new IdTypeBean("5", "学工号"));
- list.add(new IdTypeBean("9", "其他"));
- map.put("idtypes", list);
- return "system/user/add";
+ @GetMapping("/user/list")
+ @PreAuthorize("hasPermission('/user/list','')")
+ @ResponseBody
+ public PageResult<TPerson> getDataList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "searchkey", required = false) String searchKey) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ PersonParamBean searchBean = new PersonParamBean();
+ searchBean.setPageNo(pageNo);
+ searchBean.setName(searchKey);
+ searchBean.setPageSize(pageSize);
+ return userDataService.getPersonsByKey(searchBean);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
}
+ }
- @PostMapping("/user/add")
- @PreAuthorize("hasPermission('/user/add','')")
- @ResponseBody
- public JsonResult add(@RequestBody TPerson person) {
- if (StringUtil.isEmpty(person.getName())
- || StringUtil.isEmpty(person.getSex())
- || StringUtil.isEmpty(person.getIdno())
- || StringUtil.isEmpty(person.getIdtype())
- || StringUtil.isEmpty(person.getMobile())) {
- return JsonResult.error("参数错误");
- }
- return userDataService.saveUser(person);
- }
+ @GetMapping("/user/loadadd")
+ public String add(ModelMap map) {
+ map.put(Dictionary.IDTYPE, dictionaryProxy.getDictionaryAsList(Dictionary.IDTYPE));
+ return "system/user/add";
+ }
- @PostMapping("/user/del")
- @PreAuthorize("hasPermission('/user/del','')")
- @ResponseBody
- public JsonResult del(@RequestParam String userid) {
- if (StringUtil.isEmpty(userid)) {
- return JsonResult.error("参数错误");
- }
- return userDataService.deleteUser(userid);
+ @PostMapping("/user/add")
+ @PreAuthorize("hasPermission('/user/add','')")
+ @ResponseBody
+ public JsonResult add(@RequestBody TPerson person) {
+ if (StringUtil.isEmpty(person.getName())
+ || StringUtil.isEmpty(person.getSex())
+ || StringUtil.isEmpty(person.getIdno())
+ || StringUtil.isEmpty(person.getIdtype())
+ || StringUtil.isEmpty(person.getMobile())) {
+ return JsonResult.error("参数错误");
}
+ return userDataService.saveUser(person);
+ }
- @GetMapping("/user/acc")
- public String acc() {
- return "system/user/account";
+ @PostMapping("/user/del")
+ @PreAuthorize("hasPermission('/user/del','')")
+ @ResponseBody
+ public JsonResult del(@RequestParam String userid) {
+ if (StringUtil.isEmpty(userid)) {
+ return JsonResult.error("参数错误");
}
+ return userDataService.deleteUser(userid);
+ }
- @GetMapping("/user/account")
- @PreAuthorize("hasPermission('/user/account','')")
- @ResponseBody
- public PageResult<TAccount> getDataAccountList(@RequestParam("page") Integer pageNo,
- @RequestParam("limit") Integer pageSize,
- @RequestParam(value = "searchkey", required = false) String searchKey) {
- try {
- if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
- if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
- PersonParamBean searchBean = new PersonParamBean();
- searchBean.setPageNo(pageNo);
- searchBean.setName(searchKey);
- searchBean.setPageSize(pageSize);
- return userDataService.getAccountsByKey(searchBean);
- } catch (Exception e) {
- e.printStackTrace();
- return new PageResult<>(99, "系统查询错误");
- }
- }
+ @GetMapping("/user/acc")
+ public String acc() {
+ return "system/user/account";
+ }
- @GetMapping("/user/point")
- public String point() {
- return "system/user/point";
+ @GetMapping("/user/account")
+ @PreAuthorize("hasPermission('/user/account','')")
+ @ResponseBody
+ public PageResult<TAccount> getDataAccountList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "searchkey", required = false) String searchKey) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ PersonParamBean searchBean = new PersonParamBean();
+ searchBean.setPageNo(pageNo);
+ searchBean.setName(searchKey);
+ searchBean.setPageSize(pageSize);
+ return userDataService.getAccountsByKey(searchBean);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
}
+ }
- @GetMapping("/user/pointlist")
- @PreAuthorize("hasPermission('/user/pointlist','')")
- @ResponseBody
- public PageResult<TPointsAccount> getDataPointList(@RequestParam("page") Integer pageNo,
- @RequestParam("limit") Integer pageSize,
- @RequestParam(value = "searchkey", required = false) String searchKey) {
- try {
- if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
- if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
- PersonParamBean searchBean = new PersonParamBean();
- searchBean.setPageNo(pageNo);
- searchBean.setName(searchKey);
- searchBean.setPageSize(pageSize);
- return userDataService.getPointsByKey(searchBean);
- } catch (Exception e) {
- e.printStackTrace();
- return new PageResult<>(99, "系统查询错误");
- }
- }
+ @GetMapping("/user/point")
+ public String point() {
+ return "system/user/point";
+ }
- @PostMapping("/user/delacc")
- @PreAuthorize("hasPermission('/user/delacc','')")
- @ResponseBody
- public JsonResult delacc(@RequestParam String accno) {
- if (StringUtil.isEmpty(accno)) {
- return JsonResult.error("参数错误");
- }
- return userDataService.closeAccount(accno);
+ @GetMapping("/user/pointlist")
+ @PreAuthorize("hasPermission('/user/pointlist','')")
+ @ResponseBody
+ public PageResult<TPointsAccount> getDataPointList(@RequestParam("page") Integer pageNo,
+ @RequestParam("limit") Integer pageSize,
+ @RequestParam(value = "searchkey", required = false) String searchKey) {
+ try {
+ if (null == pageNo || pageNo < 1) pageNo = WebConstant.PAGENO_DEFAULT;
+ if (null == pageSize || pageSize < 1) pageSize = WebConstant.PAGESIZE_DEFAULT;
+ PersonParamBean searchBean = new PersonParamBean();
+ searchBean.setPageNo(pageNo);
+ searchBean.setName(searchKey);
+ searchBean.setPageSize(pageSize);
+ return userDataService.getPointsByKey(searchBean);
+ } catch (Exception e) {
+ e.printStackTrace();
+ return new PageResult<>(99, "系统查询错误");
}
- @PostMapping("/user/delpoint")
- @PreAuthorize("hasPermission('/user/delpoint','')")
- @ResponseBody
- public JsonResult delpoint(@RequestParam String userid) {
- if (StringUtil.isEmpty(userid)) {
- return JsonResult.error("参数错误");
- }
- return userDataService.deletePoint(userid);
+ }
+
+ @PostMapping("/user/delacc")
+ @PreAuthorize("hasPermission('/user/delacc','')")
+ @ResponseBody
+ public JsonResult delacc(@RequestParam String accno) {
+ if (StringUtil.isEmpty(accno)) {
+ return JsonResult.error("参数错误");
}
- @GetMapping("/user/pointdtl")
- public String pointdtl(@RequestParam String userid,ModelMap map) {
- map.put("userid",userid);
- return "system/user/pointdtl";
+ return userDataService.closeAccount(accno);
+ }
+
+ @PostMapping("/user/delpoint")
+ @PreAuthorize("hasPermission('/user/delpoint','')")
+ @ResponseBody
+ public JsonResult delpoint(@RequestParam String userid) {
+ if (StringUtil.isEmpty(userid)) {
+ return JsonResult.error("参数错误");
}
+ return userDataService.deletePoint(userid);
+ }
+
+ @GetMapping("/user/pointdtl")
+ public String pointdtl(@RequestParam String userid, ModelMap map) {
+ map.put("userid", userid);
+ return "system/user/pointdtl";
+ }
}
diff --git a/src/main/resources/data.sql b/src/main/resources/data.sql
index 5e91f80..b16d5a4 100644
--- a/src/main/resources/data.sql
+++ b/src/main/resources/data.sql
@@ -506,5 +506,34 @@
INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
VALUES ('cancel','dtlStatusList', '交易取消', '流水状态', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('1', 'idtypeList', '身份证', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('2', 'idtypeList', '护照', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('3', 'idtypeList', '驾照', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('4', 'idtypeList', '港澳通行证', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('5', 'idtypeList', '学工号', '证件类型', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('9', 'idtypeList', '其他', '证件类型', '{tenantid}');
+
+
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('male', 'sexList', '男', '性别', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('female', 'sexList', '女', '性别', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('unknown', 'sexList', '未知', '性别', '{tenantid}');
+
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('normal', 'accountStatusList', '正常', '账户状态', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('closed', 'accountStatusList', '注销', '账户状态', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('locked', 'accountStatusList', '锁定', '账户状态', '{tenantid}');
+INSERT INTO "tb_dictionary" ("dictval", "dicttype", "dictcaption", "dicttypename", "tenantid")
+VALUES ('unknown', 'accountStatusList', '异常', '账户状态', '{tenantid}');
----------------------------------------------------
commit;
\ No newline at end of file
diff --git a/src/main/resources/static/libs/custom.js b/src/main/resources/static/libs/custom.js
index e91928d..21e9601 100644
--- a/src/main/resources/static/libs/custom.js
+++ b/src/main/resources/static/libs/custom.js
@@ -15,7 +15,7 @@
pool: {},
addNewDict: function (dictType) {
var that = this;
- console.log("正在加载<"+dictType+">");
+ console.log("正在加载<" + dictType + ">");
$.ajax(that.url, {
method: "GET",
data: "dicttype=" + dictType,
@@ -25,11 +25,11 @@
that.storage.removeItem(dictType);
} else {
that.storage.setItem(dictType, JSON.stringify(data));
- console.log("<"+dictType+">加载成功!");
+ console.log("<" + dictType + ">加载成功!");
}
},
- error: function(e){
- console.log("<"+dictType+">加载失败!");
+ error: function (e) {
+ console.log("<" + dictType + ">加载失败!");
}
}
);
@@ -48,7 +48,7 @@
that.storage.removeItem(dictType);
} else {
that.storage.setItem(dictType, JSON.stringify(data));
- console.log("<"+dictType+">加载成功!");
+ console.log("<" + dictType + ">加载成功!");
}
},
error: function (e) {
@@ -60,7 +60,11 @@
},
initAll: function (url) {
this.url = url;
- this.addNewDict("sourcetypeList").addNewDict("reverseFlagList");
+ this.addNewDict("sourcetypeList")
+ .addNewDict("reverseFlagList")
+ .addNewDict("idtypeList")
+ .addNewDict("sexList")
+ .addNewDict("accountStatusList")
},
getDict: function (dictType) {
var dict, that = this;
diff --git a/src/main/resources/templates/system/user/account.html b/src/main/resources/templates/system/user/account.html
index cd9cc57..988fa72 100644
--- a/src/main/resources/templates/system/user/account.html
+++ b/src/main/resources/templates/system/user/account.html
@@ -9,8 +9,10 @@
<div class="layui-card-body">
<div class="layui-form toolbar">
搜索:
- <input id="search-value-account" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
- <button id="btn-search-account" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
+ <input id="search-value-account" class="layui-input search-input" type="text"
+ placeholder="输入用户名称"/> 
+ <button id="btn-search-account" class="layui-btn icon-btn" data-type="search"><i
+ class="layui-icon"></i>搜索
</button>
</div>
<table class="layui-table" id="accounttable" lay-filter="accounttable"></table>
@@ -29,36 +31,53 @@
page: true,
cols: [
[
- {field: 'accno', title: '账号',fixed: 'left', width: 100},
- {field: 'person', title: '名称', width: 80,fixed: 'left', sort: true, templet: function (item) {
- if(item.accname!=null){
+ {field: 'accno', title: '账号', fixed: 'left', width: 100},
+ {
+ field: 'person',
+ title: '名称',
+ width: 80,
+ fixed: 'left',
+ sort: true,
+ templet: function (item) {
+ if (item.accname != null) {
return item.accname;
}
return item.person.name;
- }},
- {field: 'transStatus', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
- if (item.transStatus == 'normal') {
- return '<span class="layui-badge layui-bg-green">正常</span>'
- } else if (item.transStatus == 'closed') {
- return '<span class="layui-badge">注销</span>'
- } else if (item.transStatus == 'locked') {
- return '<span class="layui-badge layui-bg-orange">锁定</span>'
- } else {
+ }
+ },
+ {
+ field: 'transStatus',
+ title: '状态',
+ fixed: 'left',
+ width: 80,
+ templet: function (item) {
+ let desc = getTempDictValue('accountStatusList', item.transStatus)
+ if (item.transStatus === 'normal') {
+ return '<span class="layui-badge layui-bg-green">' + desc + '</span>'
+ } else if (item.transStatus === 'closed') {
+ return '<span class="layui-badge">' + desc + '</span>'
+ } else if (item.transStatus === 'locked') {
+ return '<span class="layui-badge layui-bg-orange">' + desc + '</span>'
+ } else {
return '异常'
}
}
},
- {field: 'availbal', title: '可用余额', width: 100,fixed: 'left', sort: true},
- {field: 'balance', title: '总余额', width: 100,fixed: 'left', sort: true},
- {field: 'frozebal', title: '冻结余额', width: 100,fixed: 'left', sort: true},
- {field: 'lasttranstime', title: '最后交易日期', width: 120,fixed: 'left', sort: true},
- {field: 'opendate', title: '开户日期', width: 100,fixed: 'left', sort: true},
+ {field: 'availbal', title: '可用余额', width: 100, fixed: 'left', sort: true},
+ {field: 'balance', title: '总余额', width: 100, fixed: 'left', sort: true},
+ {field: 'frozebal', title: '冻结余额', width: 100, fixed: 'left', sort: true},
+ {field: 'lasttranstime', title: '最后交易日期', width: 120, fixed: 'left', sort: true},
+ {field: 'opendate', title: '开户日期', width: 100, fixed: 'left', sort: true},
{
- field: 'accno', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
- if (item.transStatus != 'closed') {
+ field: 'accno',
+ align: 'center',
+ title: '操作',
+ fixed: 'right',
+ templet: function (item) {
+ if (item.transStatus !== 'closed') {
let html = ' <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>注销</a> ';
return html;
- }else {
+ } else {
return '';
}
}
@@ -93,9 +112,9 @@
}, function (data) {
console.log(data.code);
layer.closeAll('loading');
- if (data.code == 200) {
+ if (data.code === 200) {
layer.msg(data.msg, {icon: 1});
- } else if (data.code == 401) {
+ } else if (data.code === 401) {
layer.msg(data.msg, {icon: 2, time: 1500}, function () {
location.replace('[[@{/login}]]');
}, 1000);
@@ -107,9 +126,9 @@
}, function (ret) {
console.log(ret);
layer.closeAll('loading');
- if(ret.transStatus==403){
+ if (ret.transStatus === 403) {
layer.msg('没有权限', {icon: 2});
- }else{
+ } else {
layer.msg('请求失败了,请稍后再试', {icon: 2});
}
});
diff --git a/src/main/resources/templates/system/user/index.html b/src/main/resources/templates/system/user/index.html
index dc009c7..8e13364 100644
--- a/src/main/resources/templates/system/user/index.html
+++ b/src/main/resources/templates/system/user/index.html
@@ -12,7 +12,8 @@
<input id="search-value-user" class="layui-input search-input" type="text" placeholder="输入用户名称"/> 
<button id="btn-search-user" class="layui-btn icon-btn" data-type="search"><i class="layui-icon"></i>搜索
</button>
- <button id="btn-add-user" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加用户</button>
+ <button id="btn-add-user" class="layui-btn icon-btn" data-type="add"><i class="layui-icon"></i>添加用户
+ </button>
</div>
<table class="layui-table" id="usertable" lay-filter="usertable"></table>
</div>
@@ -30,55 +31,47 @@
page: true,
cols: [
[
- {field: 'name', title: '名称', width: 80,fixed: 'left', sort: true},
- {field: 'sex', title: '性别',fixed: 'left', width: 80, templet: function (item) {
- if (item.sex === 'male') {
- return '男'
- } else if (item.sex === 'female') {
- return '女'
- } else {
- return '男'
- }
+ {field: 'name', title: '名称', width: 80, fixed: 'left', sort: true},
+ {
+ field: 'sex', title: '性别', fixed: 'left', width: 80,
+ templet: function (item) {
+ return getTempDictValue('sexList', item.sex);
}
},
- {field: 'status', title: '状态',fixed: 'left',width: 80 , templet: function (item) {
+ {
+ field: 'status', title: '状态', fixed: 'left', width: 80, templet: function (item) {
+ let desc = getTempDictValue('accountStatusList', item.status)
if (item.status === 'normal') {
- return '<span class="layui-badge layui-bg-green">正常</span>'
+ return '<span class="layui-badge layui-bg-green">' + desc + '</span>'
} else if (item.status === 'closed') {
- return '<span class="layui-badge">注销</span>'
+ return '<span class="layui-badge">' + desc + '</span>'
} else if (item.status === 'locked') {
- return '<span class="layui-badge layui-bg-orange">锁定</span>'
- } else {
+ return '<span class="layui-badge layui-bg-orange">' + desc + '</span>'
+ } else {
return '异常'
}
}
},
- {field: 'idtype', align: 'center',width: 100, title: '证件类型', fixed: 'left', templet: function (item) {
- if (item.idtype === '1') {
- return '身份证'
- } else if (item.idtype === '2') {
- return '护照'
- } else if (item.idtype === '3') {
- return '驾照'
- } else if (item.idtype === '4') {
- return '港澳通行证'
- } else if (item.idtype === '5') {
- return '学工号'
- } else {
- return '其他'
- }
+ {
+ field: 'idtype', align: 'center', width: 100, title: '证件类型', fixed: 'left',
+ templet: function (item) {
+ return getTempDictValue('idtypeList', item.idtype);
}
},
- {field: 'idno', title: '证件号', width: 120,fixed: 'left', sort: true},
- {field: 'email', title: '邮箱', width: 100,fixed: 'left', sort: true},
- {field: 'mobile', title: '手机', width: 120,fixed: 'left', sort: true},
- {field: 'tel', title: '电话', width: 100,fixed: 'left', sort: true},
- {field: 'addr', title: '地址', width: 200,fixed: 'left', sort: true},
- {field: 'lastsaved', title: '最后修改时间', width: 140,fixed: 'left', sort: true},
+ {field: 'idno', title: '证件号', width: 120, fixed: 'left', sort: true},
+ {field: 'email', title: '邮箱', width: 100, fixed: 'left', sort: true},
+ {field: 'mobile', title: '手机', width: 120, fixed: 'left', sort: true},
+ {field: 'tel', title: '电话', width: 100, fixed: 'left', sort: true},
+ {field: 'addr', title: '地址', width: 200, fixed: 'left', sort: true},
+ {field: 'lastsaved', title: '最后修改时间', width: 140, fixed: 'left', sort: true},
{
- field: 'userid', align: 'center', title: '操作', fixed: 'right', templet: function (item) {
- let html = ' <a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> ';
- html +='<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>';
+ field: 'userid',
+ align: 'center',
+ title: '操作',
+ fixed: 'right',
+ templet: function (item) {
+ let html = ' <a class="layui-btn layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a> ';
+ html += '<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>';
/*html += '<a class="layui-btn layui-btn-xs" lay-event="other"><i class="layui-icon layui-icon-link"></i>交易记录</a> ';*/
return html;
}
@@ -142,9 +135,9 @@
}, function (ret) {
console.log(ret);
layer.closeAll('loading');
- if(ret.transStatus===403){
+ if (ret.transStatus === 403) {
layer.msg('没有权限', {icon: 2});
- }else{
+ } else {
layer.msg('请求失败了,请稍后再试', {icon: 2});
}
});