<button type="button" class="add-btn btn btn-outline-primary btn-sm fa" onclick="handleAddFollow()">新增跟进</button>
<? if (isset($itemList) && !empty($itemList)): ?>
	<div class="list-content">
		<? foreach ($itemList as $item): ?>
			<div class="follow-card">
				<div class="follow-card-header">
					<? if ($item['prf_pi_status'] == -1): ?>
						<span class="follow-status cannot">无法供应</span>
					<? elseif ($item['prf_pi_status'] == 0): ?>
						<span class="follow-status to-process">待处理</span>
					<? elseif ($item['prf_pi_status'] == 1): ?>
						<span class="follow-status development">开发中</span>
					<? elseif ($item['prf_pi_status'] == 2): ?>
						<span class="follow-status can-supply">可供应</span>
					<? elseif ($item['prf_pi_status'] == 3): ?>
						<span class="follow-status product">商品</span>
					<? endif; ?>
					<span class="follow-time">
						上次更新:
						<?= date('Y-m-d H:i:s', strtotime($item['prf_update_time'])) ?>
					</span>
					<? if ($item['prf_create_time'] != $item['prf_update_time']): ?>
						<span class="spectator">|</span>
						<span class="follow-time follow-time-create">
							创建于:
							<?= date('Y-m-d H:i:s', strtotime($item['prf_create_time'])) ?>
						</span>
					<? endif; ?>
				</div>
				<div class="follow-content">
					<?= htmlspecialchars_decode($item['prf_des']) ?>
				</div>
				<? if ($item['prf_opuser'] == $session['user']['user_id']): ?>
					<span class="follow-card-footer">
						<button type="button" class="btn btn-outline-primary btn-sm fa" onclick="editFollow(<?= htmlspecialchars(json_encode($item), ENT_QUOTES, 'UTF-8') ?>)">编辑</button>
						<button type="button" class="btn btn-outline-primary btn-delete btn-sm fa" onclick="deleteFollow(<?= $item['prf_id'] ?>)">删除</button>
					</span>
				<? endif; ?>
				<? if (substr($item['prf_pi_develop_time'], 0, 4) != '0000'): ?>
					<span class="follow-card-dev">
						预计开发:
						<?= date('Y-m-d', strtotime($item['prf_pi_develop_time'])) ?>
					</span>
				<? endif; ?>
				<span class="follow-card-tip">
					<?= $item['au_name'] ?? '未知用户' ?>
				</span>
			</div>
		<? endforeach; ?>
	</div>
<? else: ?>
	<div class="no-data list-content">
		暂无跟进记录
	</div>
<? endif; ?>

<!-- 分页器 -->
<? viewLoad('components/pagination'); ?>

<script>
	$(document).ready(function() {
		initPaginationConfig({
			paginationInfo: currentPaginationInfo,
			freshDom: domCache.leftContainer
		});
	});
</script>