feat(t242): delete unused freight orders

This commit is contained in:
QiuSW
2026-07-29 16:10:45 +08:00
parent c80a5c26ed
commit e5f403ff7d
20 changed files with 915 additions and 27 deletions
@@ -13,7 +13,11 @@
<h1>{{if .Detail.Order.SourceCode}}{{.Detail.Order.SourceCode}}{{else}}货运详情{{end}}</h1>
<p class="subtitle">ERP ID:{{.Detail.Order.ExternalStockID}} · 来源版本 {{.Detail.Order.Revision}}</p>
</div>
<a class="button" href="/freight">返回列表</a>
<div class="title-actions freight-title-actions">
<a class="button" href="/freight">返回列表</a>
<button class="button danger-outline" type="button"
data-open-freight-delete>删除本地货运单</button>
</div>
</div>
{{if .Notice}}<div class="notice" role="status">{{.Notice}}</div>{{end}}
<section class="detail-section" aria-labelledby="freight-source-title">
@@ -129,6 +133,38 @@
<div class="empty-state"><h2>该货运单没有商品明细</h2></div>
{{end}}
</section>
<noscript>
<section class="noscript-cancel" aria-labelledby="freight-delete-noscript-title">
<h2 id="freight-delete-noscript-title">删除本地货运单</h2>
<p>只删除本系统保存的信息,不影响顺运宝 ERP;已进入采购流程的货运单不能删除。</p>
<form method="post" action="/freight/{{pathPart .Detail.Order.ID}}/delete">
<input type="hidden" name="csrf_token" value="{{.Page.CSRFToken}}">
<label class="confirm-line">
<input type="checkbox" name="confirm_delete" value="1" required>
<span>已确认删除本系统中的货运信息</span>
</label>
<button class="button danger" type="submit">确认删除</button>
</form>
</section>
</noscript>
<dialog class="confirm-dialog" data-freight-delete-dialog
aria-labelledby="freight-delete-title">
<h2 id="freight-delete-title">删除本地货运单?</h2>
<p>将删除本系统保存的 {{if .Detail.Order.SourceCode}}{{.Detail.Order.SourceCode}}{{else}}该货运单{{end}} 及商品图片,不影响顺运宝 ERP。已进入采购流程时系统会拒绝删除。</p>
<div class="dialog-actions">
<button class="button" type="button"
data-keep-freight-order>保留货运单</button>
<form method="post" action="/freight/{{pathPart .Detail.Order.ID}}/delete"
data-submit-form>
<input type="hidden" name="csrf_token" value="{{.Page.CSRFToken}}">
<input type="hidden" name="confirm_delete" value="1">
<button class="button danger" type="submit" data-submit-button
data-loading-label="正在删除…">确认删除</button>
</form>
</div>
</dialog>
</main>
</body>
</html>