|
@@ -2,117 +2,184 @@
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
- <title>修改密码</title>
|
|
|
+ <title>人员管理</title>
|
|
|
<meta name="renderer" content="webkit">
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
<link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
|
|
<link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
|
|
- <style type="text/css">
|
|
|
- .input {
|
|
|
- width: 70%;
|
|
|
- border-radius: 2px;
|
|
|
- height: 30px;
|
|
|
- border-width: 1px;
|
|
|
- border-color: lightgray;
|
|
|
- border-style: solid;
|
|
|
- background-color: white;
|
|
|
- padding-left: 3px;
|
|
|
- margin-top: 20px;
|
|
|
- }
|
|
|
- </style>
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
<div class="layui-fluid">
|
|
|
<div class="layui-card">
|
|
|
<div class="layui-card-body" pad15>
|
|
|
- <form class="layui-form" action="" lay-filter="component-form-element">
|
|
|
- <div class="layui-row layui-col-space10 layui-form-item">
|
|
|
- <div>
|
|
|
- <label><font color='red' size="4">*</font>商品提成比例:</label>
|
|
|
- <input type="text" name="package_percentage" lay-verify="required|numberGtZ" autocomplete="off" class="input">
|
|
|
- <label><font color='red' size="4" style="font-size: small;">佣金=商品优惠价*提成比例</font></label>
|
|
|
+ <div class="layui-row layui-col-space15">
|
|
|
+ <div class="layui-col-md12">
|
|
|
+
|
|
|
+ <div class="LAY-btns" style="margin-bottom: 10px;">
|
|
|
+ <button class="layui-btn layui-btn-sm" id="btn_add"><i class="layui-icon layui-icon-add-circle"></i>添加</button>
|
|
|
+ <button class="layui-btn layui-btn-sm" id="btn_query"><i class="layui-icon layui-icon-search"></i>查询</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <table class="layui-hide" id="datagrid" lay-filter="datagrid-operate"></table>
|
|
|
+
|
|
|
+ <script type="text/html" id="datagrid-operate-bar">
|
|
|
+ <div class="layui-btn-group">
|
|
|
+ <a class="layui-btn layui-btn-xs" lay-event="edit">修改</a>
|
|
|
+ </div>
|
|
|
+ </script>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div id="dlg_query" style="display: none">
|
|
|
+ <div class="layui-card-body" pad15>
|
|
|
+ <form class="layui-form" lay-filter="query-form-element">
|
|
|
+ <div class="layui-row layui-col-space10 layui-form-item">
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12">
|
|
|
+ <label class="layui-form-label">在职:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <select name="is_active">
|
|
|
+ <option value="" selected></option>
|
|
|
+ <option value="1">是</option>
|
|
|
+ <option value="0">否</option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <label ><font color='red' size="4">*</font>整车提成比例:</label>
|
|
|
- <input type="text" name="vehicle_percentage" lay-verify="required|numberGtZ" autocomplete="off" class="input">
|
|
|
- <label><font color='red' style="font-size: small;">佣金=车型定金*提成比例</font></label>
|
|
|
+ </div>
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12">
|
|
|
+ <label class="layui-form-label">类型:</label>
|
|
|
+ <div class="layui-input-block">
|
|
|
+ <select name="type">
|
|
|
+ <option value="" selected></option>
|
|
|
+ <option value="1">管理员</option>
|
|
|
+ <option value="2">员工</option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
- <div class="layui-form-item">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="layui-col-xs12 layui-col-sm12">
|
|
|
+ <label class="layui-form-label">员工账号:</label>
|
|
|
<div class="layui-input-block">
|
|
|
- <button class="layui-btn" lay-submit lay-filter="component-form-element">保存</button>
|
|
|
+ <input type="text" name="username" autocomplete="off" class="layui-input">
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
- <script src="../../layuiadmin/layui/layui.js"></script>
|
|
|
+ </div>
|
|
|
+ <div class="layui-form-item" style="display: none">
|
|
|
+ <button id="query_search" class="layui-btn" lay-submit lay-filter="query-form-element">查询</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <script src="../../layuiadmin/layui/layui.js?t=1"></script>
|
|
|
<script>
|
|
|
+ var _params = '';
|
|
|
layui.config({
|
|
|
base: '../../../layuiadmin/' //静态资源所在路径
|
|
|
}).extend({
|
|
|
index: 'lib/index' //主入口模块
|
|
|
- }).use(['index', 'form', 'utils'], function(){
|
|
|
+ }).use(['index', 'table'], function(){
|
|
|
var $ = layui.$
|
|
|
- ,admin = layui.admin
|
|
|
- ,element = layui.element
|
|
|
,form = layui.form;
|
|
|
- form.render(null, 'component-form-element');
|
|
|
- element.render('breadcrumb', 'breadcrumb');
|
|
|
-
|
|
|
- admin.req({
|
|
|
- url: '/tenant/config/',
|
|
|
- done: function (res) {
|
|
|
- var data = res.data;
|
|
|
- var edit_data = {};
|
|
|
- for(var i in data) {
|
|
|
- if (data[i].property === 'package_percentage'){
|
|
|
- edit_data['package_percentage'] = data[i].value;
|
|
|
- }else if (data[i].property === 'vehicle_percentage') {
|
|
|
- edit_data['vehicle_percentage'] = data[i].value;
|
|
|
- }
|
|
|
- }
|
|
|
- form.val("component-form-element", edit_data);
|
|
|
- form.render();
|
|
|
- }
|
|
|
- });
|
|
|
+ var table = layui.table;
|
|
|
|
|
|
- form.on('submit(component-form-element)', function(data){
|
|
|
- var save_data = [];
|
|
|
- if (data.field['package_percentage']){
|
|
|
- save_data.push({key: 'package_percentage', value: data.field['package_percentage']})
|
|
|
+ table.render({
|
|
|
+ elem: '#datagrid'
|
|
|
+ ,url: '/admin/user/'
|
|
|
+ ,cols: [[
|
|
|
+ {field:'username', title:'登录账号',width: 200}
|
|
|
+ ,{field:'department_text', title:'所属部门', width:300}
|
|
|
+ ,{field:'type_text', title:'类型', width:90}
|
|
|
+ ,{field:'status_text', title:'状态', width:90}
|
|
|
+ ,{width:80, align:'left',title: '操作', fixed: 'right', toolbar: '#datagrid-operate-bar'}
|
|
|
+ ]]
|
|
|
+ ,page: true
|
|
|
+ ,height: 'full-104'
|
|
|
+ ,done: function () {
|
|
|
+ //layui.index.removeNoPermButtons();
|
|
|
+ layer.closeAll('loading');
|
|
|
}
|
|
|
- if (data.field['vehicle_percentage']){
|
|
|
- save_data.push({key: 'vehicle_percentage', value: data.field['vehicle_percentage']})
|
|
|
+ });
|
|
|
+
|
|
|
+ //监听工具条
|
|
|
+ table.on('tool(datagrid-operate)', function(obj){
|
|
|
+ var data = obj.data;
|
|
|
+ if(obj.event === 'edit'){
|
|
|
+ table.editdata = data;
|
|
|
+ layer.open({
|
|
|
+ type: 2,
|
|
|
+ title: '修改',
|
|
|
+ shadeClose: false,
|
|
|
+ area: ['550px', '85%'],
|
|
|
+ btn: ['保存', '取消'],
|
|
|
+ yes: function(index, dom){
|
|
|
+ layui.onSubmitChild = function (data) {
|
|
|
+ layer.close(index);
|
|
|
+ table.reload('datagrid',{});
|
|
|
+ };
|
|
|
+ layui.submitChild();
|
|
|
+ },
|
|
|
+ btn2: function(index, layero){
|
|
|
+ layer.close(index);//关闭当前按钮
|
|
|
+ },
|
|
|
+ content: 'edit.html?id='+data.id
|
|
|
+ });
|
|
|
}
|
|
|
- admin.req({
|
|
|
- url: '/tenant/config/'
|
|
|
- ,data: {data: JSON.stringify(save_data)}
|
|
|
- ,type: 'post'
|
|
|
- ,done: function(res){
|
|
|
- layer.open({
|
|
|
- type: 1
|
|
|
- ,content: '<div style="padding: 20px 100px;">保存成功</div>'
|
|
|
- ,btn: '关闭'
|
|
|
- ,btnAlign: 'c' //按钮居中
|
|
|
- ,shade: 0 //不显示遮罩
|
|
|
- ,yes: function(){
|
|
|
- layer.closeAll();
|
|
|
- //admin.exit();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
+ $('#btn_add').on('click', function(){
|
|
|
+ layer.open({
|
|
|
+ type: 2,
|
|
|
+ title: '添加',
|
|
|
+ shadeClose: false,
|
|
|
+ area: ['550px', '85%'],
|
|
|
+ btn: ['保存', '取消'],
|
|
|
+ yes: function(index, dom){
|
|
|
+ layui.onSubmitChild = function (data) {
|
|
|
+ layer.close(index);
|
|
|
+ table.reload('datagrid',{});
|
|
|
+ };
|
|
|
+ layui.submitChild();
|
|
|
+ },
|
|
|
+ btn2: function(index, layero){
|
|
|
+ layer.close(index);//关闭当前按钮
|
|
|
+ },
|
|
|
+ content: 'edit.html'
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#btn_query').on('click', function(){
|
|
|
+ layer.open({
|
|
|
+ type: 1,
|
|
|
+ shadeClose: true,
|
|
|
+ area: ['500px', '370px'],
|
|
|
+ title: '查询',
|
|
|
+ btn: ['查询'],
|
|
|
+ yes: function(index, dom){
|
|
|
+ $('#query_search').click();
|
|
|
+ },
|
|
|
+ content: $('#dlg_query')
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ form.on('submit(query-form-element)', function(data){
|
|
|
+ //layer.msg(JSON.stringify(data.field));
|
|
|
+ _params = data.field;
|
|
|
+ table.reload('datagrid', {
|
|
|
+ where: data.field,
|
|
|
+ page:{curr:1}
|
|
|
+ });
|
|
|
+ layer.closeAll();
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|
|
|
-</html>
|
|
|
+</html>
|
|
|
+
|