feat: 固定创建真实采购任务 (#112)

This commit is contained in:
chengma
2026-08-10 17:52:48 +08:00
parent 29b4491afe
commit e1b32ea024
20 changed files with 185 additions and 82 deletions
+8 -19
View File
@@ -163,7 +163,7 @@
<button type="button" class="modal-x" data-modal-close aria-label="关闭">×</button>
</div>
<form method="post" action="/syb/create-task" data-purchase-form
data-confirm-submit="确认按下面的人民币价格上限创建采购任务?任务创建后将等待所选客户端领取。">
data-confirm-submit="确认创建真实的未付款订单?系统不会自动支付。">
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
<input type="hidden" name="order_no" value="{{.Keyword}}">
<input type="hidden" name="stage" value="{{.StageFilter}}">
@@ -172,32 +172,21 @@
<div class="field">
<label for="purchase-client">执行客户端</label>
<select id="purchase-client" name="client_id" required autofocus>
<option value="">请选择当前账号可见的客户端</option>
{{range .AssignableClients}}<option value="{{.ClientID}}" data-purchase-mode="{{.PurchaseMode}}">{{.Name}}({{.ClientID}},{{.Status}},{{if eq .PurchaseMode "live"}}支持真实下单{{else}}仅演练{{end}})</option>{{end}}
<option value="">请选择可执行真实采购的客户端</option>
{{range .AssignableClients}}<option value="{{.ClientID}}">{{.Name}}({{.ClientID}})</option>{{end}}
</select>
{{if not .AssignableClients}}<small class="missing">当前账号没有可用客户端,请先让管理员完成客户端绑定。</small>{{end}}
{{if not .AssignableClients}}<small class="missing">当前没有可执行真实采购的在线客户端。请检查客户端绑定、在线状态和真实采购授权。</small>{{end}}
</div>
<fieldset class="execution-mode-fieldset">
<legend>执行模式</legend>
<label class="choice-row">
<input type="radio" name="execution_mode" value="dry_run" checked data-execution-mode>
<span><strong>采购演练</strong><small>只验证采购流程,不在拼多多创建订单。</small></span>
</label>
<label class="choice-row">
<input type="radio" name="execution_mode" value="live" data-execution-mode>
<span><strong>真实下单(不支付)</strong><small>会在拼多多创建真实的未付款订单。</small></span>
</label>
</fieldset>
<div class="live-confirm-panel" data-live-confirm-panel hidden>
<div class="live-confirm-panel" data-live-confirm-panel>
<strong>真实下单安全确认</strong>
<p>这会产生真实未付款订单。必须选择声明 live 能力的客户端;系统不会自动支付。</p>
<label class="choice-row">
<input type="checkbox" name="live_acknowledged" value="1" data-live-acknowledged>
<input type="checkbox" name="live_acknowledged" value="1" data-live-acknowledged required>
<span>我确认本次操作会创建真实未付款订单</span>
</label>
<label for="live-confirmation">输入“创建未付款订单”继续</label>
<input id="live-confirmation" name="live_confirmation" type="text"
autocomplete="off" data-live-confirmation>
autocomplete="off" data-live-confirmation required>
</div>
<p class="hint">价格上限单位是人民币元,默认取已映射 PDD 规格的采集价;不会使用顺运宝的台币售价。</p>
{{range .Rows}}
@@ -213,7 +202,7 @@
</div>
<div class="modal-foot">
<button type="button" data-modal-close>取消</button>
<button type="submit" class="primary" {{if not .AssignableClients}}disabled{{end}}>确认创建</button>
<button type="submit" class="primary" data-purchase-submit {{if not .AssignableClients}}disabled{{end}}>确认创建真实采购任务</button>
</div>
</form>
</div>