feat: 任务树/流转卡展示驳回原因与返工备注(网页SlimCard,移动端FlowCard/SwipeCards)
This commit is contained in:
@ -146,6 +146,13 @@ const SlimCard = memo(function SlimCard({
|
|||||||
⏰ {fmtTime(task.created_at)}
|
⏰ {fmtTime(task.created_at)}
|
||||||
{task.completed_at ? ` → ${fmtTime(task.completed_at)}` : " → 至今"}
|
{task.completed_at ? ` → ${fmtTime(task.completed_at)}` : " → 至今"}
|
||||||
</p>
|
</p>
|
||||||
|
{/* 驳回/返工原因:原 REJECTED 取 reject_reason;返工节点取含“驳回/返工”的备注 */}
|
||||||
|
{(() => {
|
||||||
|
const rj = task.reject_reason;
|
||||||
|
const rm = task.remark;
|
||||||
|
const txt = rj ? `❌ 驳回: ${rj}` : (rm && /驳回|返工/.test(rm) ? rm : null);
|
||||||
|
return txt ? <p className={`${sz.sub} text-red-500 whitespace-pre-wrap`}>{txt}</p> : null;
|
||||||
|
})()}
|
||||||
{legacy && <p className={`${sz.sub} text-orange-500`}>源自: {assigneeName || (findParent(task)?.assignee_id) || "历史任务"}</p>}
|
{legacy && <p className={`${sz.sub} text-orange-500`}>源自: {assigneeName || (findParent(task)?.assignee_id) || "历史任务"}</p>}
|
||||||
{isNestedSpawn && <p className={`${sz.sub} text-purple-500`}>协助: {findParent(task)?.assignee_id || "—"}</p>}
|
{isNestedSpawn && <p className={`${sz.sub} text-purple-500`}>协助: {findParent(task)?.assignee_id || "—"}</p>}
|
||||||
{/* 操作按钮 */}
|
{/* 操作按钮 */}
|
||||||
|
|||||||
@ -16,6 +16,8 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 时间独占一行 -->
|
<!-- 时间独占一行 -->
|
||||||
<text class="fc-time">⏰ {{ fmtDate(node.created_at) }}{{ node.completed_at ? '→' + fmtDate(node.completed_at) : '→至今' }}</text>
|
<text class="fc-time">⏰ {{ fmtDate(node.created_at) }}{{ node.completed_at ? '→' + fmtDate(node.completed_at) : '→至今' }}</text>
|
||||||
|
<!-- 驳回/返工原因:原 REJECTED 取 reject_reason;返工节点取含“驳回/返工”的备注 -->
|
||||||
|
<text v-if="reasonText" style="display:block;margin:8rpx 0 0;font-size:22rpx;line-height:1.4;color:#dc2626;font-weight:600;">❌ {{ reasonText }}</text>
|
||||||
<!-- 卡片底部:全宽蓝色日志条(对齐 Web 端) -->
|
<!-- 卡片底部:全宽蓝色日志条(对齐 Web 端) -->
|
||||||
<view v-if="node.records && node.records.length" class="ft-log-bar" @tap.stop="$emit('viewRecords', node)">
|
<view v-if="node.records && node.records.length" class="ft-log-bar" @tap.stop="$emit('viewRecords', node)">
|
||||||
查看操作日志 ({{ node.records.length }}条) ›
|
查看操作日志 ({{ node.records.length }}条) ›
|
||||||
@ -34,6 +36,13 @@ export default {
|
|||||||
},
|
},
|
||||||
emits: ["viewRecords"],
|
emits: ["viewRecords"],
|
||||||
computed: {
|
computed: {
|
||||||
|
// 驳回/返工原因:原 REJECTED 有 reject_reason;返工节点原因在 remark(形如“返工任务(驳回自…原因…)”)
|
||||||
|
reasonText() {
|
||||||
|
const n = this.node || {};
|
||||||
|
if (n.reject_reason) return `驳回: ${n.reject_reason}`;
|
||||||
|
const rm = n.remark;
|
||||||
|
return rm && (rm.indexOf("驳回") >= 0 || rm.indexOf("返工") >= 0) ? rm : "";
|
||||||
|
},
|
||||||
isMainNode() {
|
isMainNode() {
|
||||||
return !this.node.parent_task_id
|
return !this.node.parent_task_id
|
||||||
|| this.node.task_type === "TRANSFER"
|
|| this.node.task_type === "TRANSFER"
|
||||||
|
|||||||
@ -41,6 +41,9 @@
|
|||||||
|
|
||||||
<text class="tc-name">{{ card.task_name }}</text>
|
<text class="tc-name">{{ card.task_name }}</text>
|
||||||
|
|
||||||
|
<!-- 被驳回原任务:显示驳回原因(返工节点原因由下方“备注”框承载) -->
|
||||||
|
<text v-if="card.reject_reason" style="display:block;margin-top:6rpx;font-size:22rpx;line-height:1.4;color:#dc2626;font-weight:600;">❌ 驳回: {{ card.reject_reason }}</text>
|
||||||
|
|
||||||
<view class="tc-meta">
|
<view class="tc-meta">
|
||||||
<view class="tc-meta-row">
|
<view class="tc-meta-row">
|
||||||
<!-- 仓储任务:assignee 为 null,直接显示系统名,不取用户头像 -->
|
<!-- 仓储任务:assignee 为 null,直接显示系统名,不取用户头像 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user