321
This commit is contained in:
parent
bd7bcc4933
commit
4ecfc90b58
|
|
@ -215,7 +215,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationEvaluate-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('base/SQReservationEvaluate/create', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationevaluate/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationEvaluate-createForm-submit)',
|
||||
function(data) {
|
||||
|
|
@ -259,7 +259,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationEvaluate-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('base/SQReservationEvaluate/edit', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationevaluate/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationEvaluate-editForm-submit)',
|
||||
function(data) {
|
||||
|
|
@ -303,7 +303,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationEvaluate-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('base/SQReservationEvaluate/details', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationevaluate/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationParticipants-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservationParticipants/create', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationparticipants/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationParticipants-createForm-submit)',
|
||||
function(data) {
|
||||
|
|
@ -288,7 +288,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationParticipants-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservationParticipants/edit', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationparticipants/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationParticipants-editForm-submit)',
|
||||
function(data) {
|
||||
|
|
@ -333,7 +333,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationParticipants-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservationParticipants/details', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationparticipants/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationReputation-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('base/SQReservationReputation/create', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationreputation/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationReputation-createForm-submit)',
|
||||
function(data) {
|
||||
|
|
@ -252,7 +252,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationReputation-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('base/SQReservationReputation/edit', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationreputation/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservationReputation-editForm-submit)',
|
||||
function(data) {
|
||||
|
|
@ -296,7 +296,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservationReputation-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('base/SQReservationReputation/details', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservationreputation/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
|
|
|
|||
|
|
@ -206,11 +206,11 @@
|
|||
title: '参与人员', sort: false, width: 300, templet: function (d) {
|
||||
if (!d.participants || d.participants.length === 0) {
|
||||
return '<div style="margin-bottom: 5px;">' +
|
||||
'<span style="background: #1E9FFF; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-right: 5px;">参与者</span>' +
|
||||
'<span style="color: #666; font-size: 12px;">(0人)</span>' +
|
||||
'<span style="background: #5FB878; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-left: 5px; cursor: pointer;" onclick="addParticipant(' + d.id + ')">添加参与者</span>' +
|
||||
'</div>' +
|
||||
'<div style="color: #999; font-style: italic;">暂无参与人员</div>';
|
||||
'<span style="background: #1E9FFF; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-right: 5px;">参与者</span>' +
|
||||
'<span style="color: #666; font-size: 12px;">(0人)</span>' +
|
||||
'<span style="background: #5FB878; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px; margin-left: 5px; cursor: pointer;" onclick="addParticipant(' + d.id + ')">添加参与者</span>' +
|
||||
'</div>' +
|
||||
'<div style="color: #999; font-style: italic;">暂无参与人员</div>';
|
||||
}
|
||||
|
||||
var html = '<div style="line-height: 1.6;line-height: 1.6;overflow: auto;height: 100%;width: 100%;">';
|
||||
|
|
@ -298,7 +298,7 @@
|
|||
html += '<span style="color: #999;">退出时间:</span>' + it.quit_time;
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
|
||||
// 显示鸽子费退款状态
|
||||
if (it.is_refund !== undefined && it.is_refund !== null) {
|
||||
var refundText = '';
|
||||
|
|
@ -390,7 +390,7 @@
|
|||
},
|
||||
{
|
||||
title: '状态', sort: false, width: 80, templet: function (d) {
|
||||
var statusMap = { '0': '组局中', '1': '待开始', '2': '进行中', '3': '已结束',4:'已取消' };
|
||||
var statusMap = { '0': '组局中', '1': '待开始', '2': '进行中', '3': '已结束', 4: '已取消' };
|
||||
var statusKey = d.status == null ? null : String(d.status);
|
||||
return statusMap[statusKey] || '未知';
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservations-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservations/create', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservations/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservations-createForm-submit)',
|
||||
function (data) {
|
||||
|
|
@ -516,7 +516,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservations-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservations/edit', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservations/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQReservations-editForm-submit)',
|
||||
function (data) {
|
||||
|
|
@ -565,7 +565,7 @@
|
|||
area: ['1200px', '90%'],
|
||||
id: 'LAY-popup-SQReservations-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQReservations/details', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqreservations/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
|
|
@ -582,7 +582,7 @@
|
|||
function doViewParticipants(obj) {
|
||||
var reservationData = obj.data;
|
||||
var participants = reservationData.participants || [];
|
||||
|
||||
|
||||
// 弹出查看参与者窗口
|
||||
layer.open({
|
||||
type: 1,
|
||||
|
|
@ -627,17 +627,17 @@
|
|||
</div>
|
||||
</div>
|
||||
`,
|
||||
success: function(layero, index) {
|
||||
success: function (layero, index) {
|
||||
// 初始化参与者表格
|
||||
layui.use(['table'], function() {
|
||||
layui.use(['table'], function () {
|
||||
var table = layui.table;
|
||||
|
||||
|
||||
// 处理参与者数据并排序
|
||||
var tableData = participants.map(function(p) {
|
||||
var tableData = participants.map(function (p) {
|
||||
var roleText = p.role == 1 ? '发起者' : '参与者';
|
||||
var statusText = p.status == 0 ? '正常' : '已退出';
|
||||
var statusColor = p.status == 0 ? '#5FB878' : '#FF5722';
|
||||
|
||||
|
||||
var refundText = '';
|
||||
var refundColor = '';
|
||||
if (p.is_refund !== undefined && p.is_refund !== null) {
|
||||
|
|
@ -647,14 +647,18 @@
|
|||
refundColor = '#999';
|
||||
break;
|
||||
case 1:
|
||||
refundText = '已付鸽子费';
|
||||
refundText = '未付鸽子费';
|
||||
refundColor = '#1E9FFF';
|
||||
break;
|
||||
case 2:
|
||||
refundText = '退款中';
|
||||
refundText = '已付鸽子费';
|
||||
refundColor = '#FFB800';
|
||||
break;
|
||||
case 3:
|
||||
refundText = '退款中';
|
||||
refundColor = '#5FB878';
|
||||
break;
|
||||
case 4:
|
||||
refundText = '退款成功';
|
||||
refundColor = '#5FB878';
|
||||
break;
|
||||
|
|
@ -667,7 +671,7 @@
|
|||
refundColor = '#999';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
id: p.id,
|
||||
user_id: p.user_id,
|
||||
|
|
@ -686,59 +690,59 @@
|
|||
});
|
||||
|
||||
// 排序:发起者 > 正常参与者 > 已退出参与者(按退出时间倒序)
|
||||
tableData.sort(function(a, b) {
|
||||
tableData.sort(function (a, b) {
|
||||
// 首先按角色排序:发起者(1) > 参与者(0)
|
||||
if (a.roleValue !== b.roleValue) {
|
||||
return b.roleValue - a.roleValue; // 发起者在前
|
||||
}
|
||||
|
||||
|
||||
// 然后按状态排序:正常(0) > 已退出(1)
|
||||
if (a.statusValue !== b.statusValue) {
|
||||
return a.statusValue - b.statusValue; // 正常在前
|
||||
}
|
||||
|
||||
|
||||
// 最后按退出时间排序(已退出的参与者)
|
||||
if (a.statusValue === 1 && b.statusValue === 1) {
|
||||
var quitTimeA = a.quit_time === '无' ? '1970-01-01' : a.quit_time;
|
||||
var quitTimeB = b.quit_time === '无' ? '1970-01-01' : b.quit_time;
|
||||
return new Date(quitTimeB) - new Date(quitTimeA); // 退出时间倒序
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
});
|
||||
|
||||
|
||||
table.render({
|
||||
elem: '#participantsTable',
|
||||
data: tableData,
|
||||
page: false,
|
||||
height: '280px',
|
||||
cols: [[
|
||||
{field: 'id', title: 'ID', width: 60},
|
||||
{field: 'user_id', title: '用户ID', width: 80},
|
||||
{field: 'userName', title: '用户名', width: 120},
|
||||
{field: 'role', title: '角色', width: 80},
|
||||
{ field: 'id', title: 'ID', width: 60 },
|
||||
{ field: 'user_id', title: '用户ID', width: 80 },
|
||||
{ field: 'userName', title: '用户名', width: 120 },
|
||||
{ field: 'role', title: '角色', width: 80 },
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
width: 80,
|
||||
templet: function(d) {
|
||||
templet: function (d) {
|
||||
return '<span style="background: ' + d.statusColor + '; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px;">' + d.status + '</span>';
|
||||
}
|
||||
},
|
||||
{field: 'join_time', title: '参与时间', width: 150},
|
||||
{field: 'quit_time', title: '退出时间', width: 150},
|
||||
{ field: 'join_time', title: '参与时间', width: 150 },
|
||||
{ field: 'quit_time', title: '退出时间', width: 150 },
|
||||
{
|
||||
field: 'refund_status',
|
||||
title: '鸽子费状态',
|
||||
field: 'refund_status',
|
||||
title: '鸽子费状态',
|
||||
width: 100,
|
||||
templet: function(d) {
|
||||
templet: function (d) {
|
||||
if (d.refund_status) {
|
||||
return '<span style="background: ' + d.refund_color + '; color: white; padding: 2px 6px; border-radius: 3px; font-size: 12px;">' + d.refund_status + '</span>';
|
||||
}
|
||||
return '无';
|
||||
}
|
||||
},
|
||||
{field: 'remarks', title: '备注', width: 200}
|
||||
{ field: 'remarks', title: '备注', width: 200 }
|
||||
]]
|
||||
});
|
||||
});
|
||||
|
|
@ -931,9 +935,9 @@
|
|||
</div>
|
||||
</div>
|
||||
`,
|
||||
success: function(layero, index) {
|
||||
success: function (layero, index) {
|
||||
// 初始化用户表格
|
||||
layui.use(['table'], function() {
|
||||
layui.use(['table'], function () {
|
||||
var table = layui.table;
|
||||
table.render({
|
||||
elem: '#userTable',
|
||||
|
|
@ -943,16 +947,16 @@
|
|||
limit: 10,
|
||||
limits: [10, 20, 50],
|
||||
cols: [[
|
||||
{type: 'radio', fixed: 'left'},
|
||||
{field: 'id', title: '用户ID', width: 80},
|
||||
{field: 'userName', title: '用户名', width: 150},
|
||||
{field: 'nickName', title: '昵称', width: 150},
|
||||
{field: 'mobile', title: '手机号', width: 120},
|
||||
{field: 'email', title: '邮箱', width: 200}
|
||||
{ type: 'radio', fixed: 'left' },
|
||||
{ field: 'id', title: '用户ID', width: 80 },
|
||||
{ field: 'userName', title: '用户名', width: 150 },
|
||||
{ field: 'nickName', title: '昵称', width: 150 },
|
||||
{ field: 'mobile', title: '手机号', width: 120 },
|
||||
{ field: 'email', title: '邮箱', width: 200 }
|
||||
]],
|
||||
done: function() {
|
||||
done: function () {
|
||||
// 监听行选择
|
||||
table.on('radio(userTable)', function(obj) {
|
||||
table.on('radio(userTable)', function (obj) {
|
||||
// 存储选中的用户
|
||||
window.selectedUser = obj.data;
|
||||
});
|
||||
|
|
@ -961,31 +965,31 @@
|
|||
});
|
||||
},
|
||||
btn: ['确定', '取消'],
|
||||
yes: function(index, layero) {
|
||||
yes: function (index, layero) {
|
||||
if (!window.selectedUser) {
|
||||
layer.msg('请先选择一个用户', {icon: 2});
|
||||
layer.msg('请先选择一个用户', { icon: 2 });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 确认添加参与者
|
||||
layer.confirm('确定要添加用户 "' + window.selectedUser.userName + '" 为参与者吗?', {
|
||||
icon: 3,
|
||||
title: '确认添加'
|
||||
}, function(confirmIndex) {
|
||||
}, function (confirmIndex) {
|
||||
layer.close(confirmIndex);
|
||||
|
||||
|
||||
// 调用API添加参与者
|
||||
coreHelper.Post("Api/SQReservations/AddParticipant", {
|
||||
reservationId: reservationId,
|
||||
userId: window.selectedUser.id
|
||||
}, function(e) {
|
||||
}, function (e) {
|
||||
if (e.code === 0) {
|
||||
layer.msg('添加参与者成功', {icon: 1});
|
||||
layer.msg('添加参与者成功', { icon: 1 });
|
||||
layer.close(index);
|
||||
// 重新加载表格数据
|
||||
layui.table.reloadData('LAY-app-SQReservations-tableBox');
|
||||
} else {
|
||||
layer.msg(e.msg || '添加失败', {icon: 2});
|
||||
layer.msg(e.msg || '添加失败', { icon: 2 });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
@ -997,10 +1001,10 @@
|
|||
function searchUsers() {
|
||||
var searchText = document.getElementById('searchUserInput').value.trim();
|
||||
if (!searchText) {
|
||||
layer.msg('请输入搜索内容', {icon: 2});
|
||||
layer.msg('请输入搜索内容', { icon: 2 });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// 重新加载用户表格
|
||||
layui.table.reloadData('userTable', {
|
||||
where: {
|
||||
|
|
@ -1014,22 +1018,22 @@
|
|||
layer.confirm('确定要将用户 "' + (participant.UserName || '用户' + participant.user_id) + '" 设置为发起者吗?', {
|
||||
icon: 3,
|
||||
title: '确认操作'
|
||||
}, function(index) {
|
||||
}, function (index) {
|
||||
// 关闭确认框
|
||||
layer.close(index);
|
||||
|
||||
|
||||
// 调用API设置发起者
|
||||
coreHelper.Post("Api/SQReservations/BecomeInitiator", {
|
||||
reservationId: reservationId,
|
||||
participantId: participant.id,
|
||||
userId: participant.user_id
|
||||
}, function(e) {
|
||||
}, function (e) {
|
||||
if (e.code === 0) {
|
||||
layer.msg('设置发起者成功', {icon: 1});
|
||||
layer.msg('设置发起者成功', { icon: 1 });
|
||||
// 重新加载表格数据
|
||||
layui.table.reloadData('LAY-app-SQReservations-tableBox');
|
||||
} else {
|
||||
layer.msg(e.msg || '操作失败', {icon: 2});
|
||||
layer.msg(e.msg || '操作失败', { icon: 2 });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@
|
|||
area: ['800px', '300px'],
|
||||
id: 'LAY-popup-SQRooms-create',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQRooms/create', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqrooms/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQRooms-createForm-submit)',
|
||||
function (data) {
|
||||
|
|
@ -251,7 +251,7 @@
|
|||
area: ['800px', '300px'],
|
||||
id: 'LAY-popup-SQRooms-edit',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQRooms/edit', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqrooms/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQRooms-editForm-submit)',
|
||||
function (data) {
|
||||
|
|
@ -296,7 +296,7 @@
|
|||
area: ['800px', '300px'],
|
||||
id: 'LAY-popup-SQRooms-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQRooms/details', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqrooms/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@
|
|||
console.log(e.data);
|
||||
e.data={};
|
||||
e.data.roomOptions = opts;
|
||||
view(this.id).render('sq/SQRoomUnavailableTimes/create', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqroomunavailabletimes/create', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQRoomUnavailableTimes-createForm-submit)',
|
||||
function (data) {
|
||||
|
|
@ -263,7 +263,7 @@
|
|||
id: 'LAY-popup-SQRoomUnavailableTimes-edit',
|
||||
success: function (layero, index) {
|
||||
e.data.roomOptions = opts;
|
||||
view(this.id).render('sq/SQRoomUnavailableTimes/edit', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqroomunavailabletimes/edit', { data: e.data }).done(function () {
|
||||
//监听提交
|
||||
form.on('submit(LAY-app-SQRoomUnavailableTimes-editForm-submit)',
|
||||
function (data) {
|
||||
|
|
@ -305,7 +305,7 @@
|
|||
area: ['900px', '500px'],
|
||||
id: 'LAY-popup-SQRoomUnavailableTimes-details',
|
||||
success: function (layero, index) {
|
||||
view(this.id).render('sq/SQRoomUnavailableTimes/details', { data: e.data }).done(function () {
|
||||
view(this.id).render('sq/sqroomunavailabletimes/details', { data: e.data }).done(function () {
|
||||
form.render();
|
||||
});
|
||||
// 禁止弹窗出现滚动条
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user