';
var initiator = null;
var participants = [];
-
+
// 分离发起者和参与者
- d.participants.forEach(function(it) {
+ d.participants.forEach(function (it) {
if (it.role == 1) {
initiator = it;
} else {
participants.push(it);
}
});
-
+
// 显示发起者
if (initiator) {
html += '
';
@@ -228,30 +228,30 @@
html += '' + (initiator.UserName || '用户' + initiator.user_id) + '';
html += '(ID: ' + initiator.user_id + ')';
html += '
';
-
+
// 显示发起时间
if (initiator.join_time) {
html += '
';
html += '发起时间:' + initiator.join_time;
html += '
';
}
-
+
html += '
';
}
-
+
// 显示参与者
if (participants.length > 0) {
// 统计正常状态的参与者数量
- var normalParticipantsCount = participants.filter(function(it) {
+ var normalParticipantsCount = participants.filter(function (it) {
return it.status == 0;
}).length;
-
+
html += '';
html += '
';
html += '' + (it.UserName || '用户' + it.user_id) + '';
@@ -269,15 +269,19 @@
if (statusText) {
html += '' + statusText + '';
}
+ // 当用户状态为正常时,显示强制退出按钮
+ if (it.status == 0) {
+ html += '强制退出';
+ }
html += '
';
-
+
// 显示参与时间
if (it.join_time) {
html += '
';
html += '参与时间:' + it.join_time;
html += '
';
}
-
+
// 显示退出时间(仅当状态为已退出时)
if (it.status == 1 && it.quit_time) {
html += '
';
@@ -285,10 +289,45 @@
html += '
';
}
+ // 显示鸽子费退款状态
+ if (it.is_refund !== undefined && it.is_refund !== null) {
+ var refundText = '';
+ var refundColor = '';
+ switch (it.is_refund) {
+ case 0:
+ refundText = '无需退款';
+ refundColor = '#999';
+ break;
+ case 1:
+ refundText = '已付鸽子费';
+ refundColor = '#1E9FFF';
+ break;
+ case 2:
+ refundText = '退款中';
+ refundColor = '#FFB800';
+ break;
+ case 3:
+ refundText = '退款成功';
+ refundColor = '#5FB878';
+ break;
+ case 9:
+ refundText = '退款失败';
+ refundColor = '#FF5722';
+ break;
+ default:
+ refundText = '未知状态';
+ refundColor = '#999';
+ }
+ html += '
';
+ html += '鸽子费:';
+ html += '' + refundText + '';
+ html += '
';
+ }
+
html += '
';
});
}
-
+
html += '';
return html;
}
@@ -661,4 +700,28 @@
form.render();
});
};
+
+ // 强制退出参与者函数
+ function forceExitParticipant(participant, reservationId) {
+ layer.confirm('确定要强制退出该参与者吗?如果用户已付鸽子费,会自动退还!', {
+ icon: 3,
+ title: '确认操作'
+ }, function (index) {
+ // 关闭确认框
+ layer.close(index);
+
+ // 调用API强制退出参与者
+ coreHelper.Post("Api/SQReservations/ForceExitParticipant", {
+ id: reservationId,
+ }, function (e) {
+ if (e.code === 0) {
+ layer.msg('强制退出成功', { icon: 1 });
+ // 重新加载表格数据
+ layui.table.reloadData('LAY-app-SQReservations-tableBox');
+ } else {
+ layer.msg(e.msg || '操作失败', { icon: 2 });
+ }
+ });
+ });
+ }
\ No newline at end of file