Files
cmautobuy/admin/templates/task/detail_modal.html
T

77 lines
2.6 KiB
HTML
Raw Normal View History

{{define "task/detail_modal"}}
{{/* 双击一行时弹出的内容。
这是一个**片段**,不是整页——外面的弹窗壳子在 task/list.html 里。
`[必须]` 只读:本工单不做改派、重试、取消,弹窗里不放对应的表单和按钮,
见 #19。采购专有字段(目标规格/数量/订单总价上限)在采集任务这里
**整段隐藏**,不显示空行。 */}}
{{with .D}}
<div class="modal-head">
<h2>任务 {{.TaskID}}</h2>
<button type="button" class="modal-x" data-modal-close aria-label="关闭">×</button>
</div>
<div class="modal-body">
<dl class="detail">
<dt>类型</dt><dd>{{.TypeText}}</dd>
<dt>执行模式</dt><dd>{{.ExecutionModeText}}</dd>
<dt>状态</dt><dd>{{.StatusText}}</dd>
<dt>客户端名称</dt><dd>{{.ClientText}}</dd>
<dt>客户端 ID</dt><dd>{{.ClientIDText}}</dd>
<dt>创建人</dt><dd>{{.CreatorText}}</dd>
<dt>领取时间</dt><dd>{{.ClaimedAt}}</dd>
<dt>完成时间</dt><dd>{{.FinishedAt}}</dd>
</dl>
<h3>执行参数</h3>
<dl class="detail">
<dt>PDD 链接</dt>
<dd><a href="{{.PddGoodsURL}}" target="_blank" rel="noopener noreferrer">{{.PddGoodsURL}}</a></dd>
<dt>PDD 店铺</dt><dd>{{.PddShopText}}</dd>
{{/* 下面三项只有采购任务才有;采集任务这里整段不出现,不显示空行 */}}
{{if .IsPurchase}}
<dt>目标规格</dt><dd>{{.SpecText}}</dd>
<dt>数量</dt><dd>{{.QuantityText}}</dd>
<dt>订单总价上限</dt><dd>{{.PriceLimitText}}</dd>
{{end}}
</dl>
{{if .IsPurchase}}
<h3>PDD 核单结果</h3>
{{if .HasPddOrder}}
<dl class="detail">
<dt>PDD 订单编号</dt><dd>{{.PddOrderNo}}</dd>
<dt>下单时间</dt><dd>{{.PddOrderedAt}}</dd>
<dt>上报时付款状态</dt><dd>{{.PddPaymentStatusText}}</dd>
</dl>
<p class="hint">{{.PddOrderResultText}}</p>
{{else}}
<p class="hint">{{.PddOrderResultText}}</p>
{{end}}
{{end}}
{{if .HasError}}
<h3>错误</h3>
<dl class="detail">
<dt>错误码</dt><dd>{{.ErrorCode}}</dd>
<dt>错误说明</dt><dd>{{.ErrorMessage}}</dd>
</dl>
{{end}}
{{if .HasResult}}
{{/* 完整结果默认折叠,避免一进来就糊一屏 JSON;超长时已经在 service 层
截断过,这里如实告诉操作员被截断了。 */}}
<details>
<summary>完整结果(result_data)</summary>
<pre class="result-data">{{.ResultData}}{{if .ResultTruncated}}……(已截断,仅显示前 4000 字符){{end}}</pre>
</details>
{{end}}
</div>
<div class="modal-foot">
<button type="button" data-modal-close>关闭</button>
</div>
{{end}}
{{end}}