提交 c123bde2 编写于 作者: doc_wei's avatar doc_wei

门店人员分配功能完成

上级 eeb19b95
......@@ -42,16 +42,16 @@ layui.config({
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { // 编辑
editmember(data);
edit(data);
}else if (layEvent === 'delete') { // 删除
deletemember(data);
delet(data);
}else if(layEvent == 'select'){ // 详情
selectMember(data)
select(data)
}
});
// 编辑
function editmember(data){
function edit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/area/areaEdit.html",
......@@ -69,7 +69,7 @@ layui.config({
}
// 删除
function deletemember(data){
function delet(data){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
AjaxPostUtil.request({url: shopBasePath + "area004", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function(json){
......@@ -84,7 +84,7 @@ layui.config({
}
// 详情
function selectMember(data){
function select(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/area/areaInfo.html",
......
......@@ -48,16 +48,16 @@ layui.config({
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { // 编辑
editmember(data);
edit(data);
}else if (layEvent === 'delete') { // 删除
deletemember(data);
delet(data);
}else if(layEvent == 'select'){ // 详情
selectMember(data)
select(data)
}
});
// 编辑
function editmember(data){
function edit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/store/storeEdit.html",
......@@ -75,7 +75,7 @@ layui.config({
}
// 删除
function deletemember(data){
function delet(data){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
AjaxPostUtil.request({url: shopBasePath + "store004", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function(json){
......@@ -90,7 +90,7 @@ layui.config({
}
// 详情
function selectMember(data){
function select(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/store/storeInfo.html",
......
var rowId = "";
// 已选择的员工信息
var checkStaffList = [];
// 多选
var userStaffCheckType = true;
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
authBtn('1643984717466');
// 加载区域
shopUtil.getShopAreaMation(function (json){
$("#areaId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), json));
loadStore("-");
});
form.on('select(areaId)', function(data) {
var thisRowValue = data.value;
thisRowValue = isNull(thisRowValue) ? "-" : thisRowValue;
loadStore(thisRowValue);
});
matchingLanguage();
form.render();
var chooseStoreId = "";
function loadStore(areaId){
table.render({
id: 'storeTable',
elem: '#storeTable',
method: 'get',
url: shopBasePath + 'store007',
where: {areaId: areaId},
even: true,
page: false,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], fixed: 'left', type: 'numbers'},
{ field: 'name', title: '门店', align: 'left', width: 150, templet: function(d){
return '<a lay-event="select" class="notice-title-click">' + d.name + '</a>';
}}
]],
done: function(){
matchingLanguage();
}
});
table.on('tool(storeTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if(layEvent == 'select'){
chooseStoreId = data.id;
loadStaff(data.id);
}
});
chooseStoreId = "";
loadStaff("-");
}
function loadStaff(storeId){
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: shopBasePath + 'storeStaff001',
where: {storeId: storeId},
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], fixed: 'left', type: 'numbers'},
{ field: 'jobNumber', title: '工号', align: 'left', width: 140 },
{ field: 'userName', title: '姓名', width: 120 },
{ field: 'companyName', title: '企业', width: 150 },
{ field: 'departmentName', title: '部门', width: 140 },
{ field: 'jobName', title: '职位', width: 140 },
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 150, toolbar: '#tableBar'}
]],
done: function(){
matchingLanguage();
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'delete') { // 删除
delet(data);
}
});
}
// 删除
function delet(data){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
AjaxPostUtil.request({url: shopBasePath + "storeStaff002", params: {id: data.id}, type: 'json', method: "DELETE", callback: function(json){
if(json.returnCode == 0){
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
table.reload("messageTable", {page: {curr: 1}, where: {storeId: chooseStoreId}})
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
});
}
// 添加
$("body").on("click", "#addBean", function(){
if(isNull(chooseStoreId)){
winui.window.msg('请先选择门店信息.', {icon: 2, time: 2000});
return false;
}
checkStaffList = [];
_openNewWindows({
url: "../../tpl/syseveuserstaff/sysEveUserStaffChoose.html",
title: "选择员工",
pageId: "sysEveUserStaffChoose",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
var list = new Array();
$.each(checkStaffList, function (i, item){
list.push(item.id);
});
var params = {
storeId: chooseStoreId,
staffId: JSON.stringify(list)
};
AjaxPostUtil.request({url: shopBasePath + "storeStaff003", params: params, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
loadStaff(chooseStoreId);
}else{
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
}
}});
});
exports('storeStaffDistribute', {});
});
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body style="background-color: rgb(242, 242, 242);">
<div class="layui-fluid">
<form class="layui-form" action="" id="showForm">
<div class="layui-col-xs12 margin-top-10 layui-col-space15">
<div class="winui-toolbar layui-col-xs12">
<div class="winui-tool layui-col-xs3">
<select id="areaId" name="areaId" lay-filter="areaId" lay-search="">
</select>
</div>
</div>
<div class="layui-col-xs3">
<div class="layui-card">
<div class="layui-card-header">门店</div>
<div class="layui-card-body">
<table id="storeTable" lay-filter="storeTable"></table>
</div>
</div>
</div>
<div class="layui-col-xs9">
<div class="layui-card">
<div class="layui-card-header">员工</div>
<div class="layui-card-body">
<div class="winui-toolbar">
<div class="winui-tool">
<button id="addBean" class="winui-toolbtn" auth="1643984717466" type="button"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(auth('1643984706160')){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
</script>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/storeStaff/'}).use('storeStaffDistribute');
</script>
</body>
</html>
\ No newline at end of file
......@@ -214,13 +214,13 @@ layui.config({
winui.window.msg("请选择员工", {icon: 2,time: 2000});
return false;
}
AjaxPostUtil.request({url:reqBasePath + "staff009", params: {ids: selectedData.toString()}, type:'json', callback:function(json){
AjaxPostUtil.request({url: reqBasePath + "staff009", params: {ids: selectedData.toString()}, type: 'json', method: "POST", callback: function(json){
if(json.returnCode == 0){
parent.checkStaffList = [].concat(json.rows);
parent.layer.close(index);
parent.refreshCode = '0';
}else{
winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}});
});
......
......@@ -72,7 +72,7 @@ var AjaxPostUtil = {
while (win != win.top){
win = win.top;
}
win.location.href = reqBasePath + "/tpl/index/login.html";//XMLHttpRequest.getResponseHeader("CONTEXTPATH");
win.location.href = "../../tpl/index/login.html";//XMLHttpRequest.getResponseHeader("CONTEXTPATH");
}else if(sessionstatus == "NOAUTHPOINT"){
returnValue = eval('(' + '{"returnMessage":"您不具备该权限。","returnCode":-9999,"total":0,"rows":"","bean":""}' + ')');
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册