47 lines
1.8 KiB
Go Template
47 lines
1.8 KiB
Go Template
{{define "freight-import"}}
|
|
<!doctype html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<title>{{.Page.Title}} - 采购任务管理</title>
|
|
{{template "document-head" .}}
|
|
</head>
|
|
<body>
|
|
{{template "site-header" .}}
|
|
<main id="main-content" class="page narrow-page">
|
|
<div class="title-row">
|
|
<div>
|
|
<h1>导入 ERP 货运</h1>
|
|
<p class="subtitle">使用 ERP 页面“全部单号”中的完整单号</p>
|
|
</div>
|
|
<a class="button" href="/freight">返回列表</a>
|
|
</div>
|
|
{{if .Error}}<div class="notice danger" role="alert">{{.Error}}</div>{{end}}
|
|
{{if .Sync}}
|
|
<section class="detail-section" aria-labelledby="sync-result-title">
|
|
<h2 id="sync-result-title">同步状态</h2>
|
|
<dl class="detail-grid">
|
|
<div><dt>状态</dt><dd>{{.Sync.Status}}</dd></div>
|
|
<div><dt>货运单</dt><dd>{{.Sync.OrderCount}}</dd></div>
|
|
<div><dt>商品明细</dt><dd>{{.Sync.ItemCount}}</dd></div>
|
|
<div><dt>错误码</dt><dd>{{if .Sync.ErrorCode}}{{.Sync.ErrorCode}}{{else}}无{{end}}</dd></div>
|
|
</dl>
|
|
{{if or (eq .Sync.Status "PENDING") (eq .Sync.Status "RUNNING")}}
|
|
<p class="secondary">同步仍在后台执行,刷新本页查看结果。</p>
|
|
{{end}}
|
|
</section>
|
|
{{end}}
|
|
<form class="form-panel" method="post" action="/freight/import" data-loading-form>
|
|
<input type="hidden" name="csrf_token" value="{{.Page.CSRFToken}}">
|
|
<input type="hidden" name="idempotency_key" value="{{.IdempotencyKey}}">
|
|
<div class="field">
|
|
<label for="order-number">完整单号</label>
|
|
<input id="order-number" name="order_number" value="{{.OrderNumber}}"
|
|
maxlength="128" autocomplete="off" required>
|
|
</div>
|
|
<button class="button primary" type="submit" data-loading-label="正在创建…">开始同步</button>
|
|
</form>
|
|
</main>
|
|
</body>
|
|
</html>
|
|
{{end}}
|