diff --git a/application/admin/controller/orders/Abnormal.php b/application/admin/controller/orders/Abnormal.php index 4ec3662..724dc15 100644 --- a/application/admin/controller/orders/Abnormal.php +++ b/application/admin/controller/orders/Abnormal.php @@ -89,7 +89,7 @@ class Abnormal extends Backend { if (false === $this->request->isPost()) { - $order_id = $this->request->get('order_id'); + $order_id = $this->request->get('ids'); $this->assign('order_id',$order_id); diff --git a/application/admin/view/orders/abnormal/add.html b/application/admin/view/orders/abnormal/add.html index b038108..7b51559 100644 --- a/application/admin/view/orders/abnormal/add.html +++ b/application/admin/view/orders/abnormal/add.html @@ -26,7 +26,7 @@
- +
diff --git a/application/admin/view/orders/abnormal/edit.html b/application/admin/view/orders/abnormal/edit.html index 936939e..4332711 100644 --- a/application/admin/view/orders/abnormal/edit.html +++ b/application/admin/view/orders/abnormal/edit.html @@ -35,7 +35,7 @@
- +
diff --git a/application/admin/view/orders/dispatch2/index.html b/application/admin/view/orders/dispatch2/index.html index 357e0a2..4f3b9cc 100644 --- a/application/admin/view/orders/dispatch2/index.html +++ b/application/admin/view/orders/dispatch2/index.html @@ -22,7 +22,7 @@ {:__('Delete')} --> - {:__('创建异常')} + {:__('创建异常')} {:__('取消任务')} diff --git a/public/assets/js/backend/orders/dispatch2.js b/public/assets/js/backend/orders/dispatch2.js index b93189d..9b62004 100644 --- a/public/assets/js/backend/orders/dispatch2.js +++ b/public/assets/js/backend/orders/dispatch2.js @@ -170,10 +170,42 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($, return; } }); + }); }); + + // 获取选中项 + $(document).on("click", ".btn-add-normal", function () { + // 获取选中项的 ID + var selectedData = Table.api.selecteddata(table); + var selectedIds = selectedData.map(item => item.id); // 假设每行数据有 `id` 字段 + + if (selectedIds.length === 0) { + Layer.alert("请先选择至少一项数据!"); + return; + } + + if(selectedIds.length > 1){ + Layer.alert("创建异常,一次只能选择一条订单!"); + return; + } + + // 拼接 ids 到 URL 后面 + var url = 'orders/abnormal/add?ids=' + selectedIds.join(','); + + // 打开弹窗 + Fast.api.open( + url, + "新增订单异常", // 弹窗标题 + { + area: ['800px', '600px'] // 设置弹窗宽度和高度,可以根据需求调整 + } + ); + }); + + }, add: function () { Controller.api.bindevent();