diff --git a/admin/controllers/items/Transfer.php b/admin/controllers/items/Transfer.php index b9c16685..a07e1e4b 100644 --- a/admin/controllers/items/Transfer.php +++ b/admin/controllers/items/Transfer.php @@ -467,6 +467,35 @@ class Transfer extends HD_Controller return $this->show_view('items/transfer/get_add', true); } + /** + * Notes:短信提醒 + * Created on: 2022/1/5 10:05 + * Created by: dengbw + * @return bool + */ + public function get_send_alisms() + { + $ids = $this->input->get('ids'); + if (!$ids) { + return $this->show_json(SYS_CODE_FAIL, '请选择需要操作的数据!'); + } + $res = $this->mdTransfer->select(["id in({$ids})" => null, 'status in(0,1)' => null], 'id desc', 0, 0, 'id,item_id'); + foreach ($res as $key => $value) { + $res_r = $this->mdTransferRemind->select(['status' => 1, 'tran_id' => $value['id']], 'type asc', 0, 0, 'uid'); + $res_a = $this->mdTransferAdmin->select(['status' => 1, 'tran_id' => $value['id']], 'type asc', 0, 0, 'uid'); + $item_info = $this->item_info($value['item_id'], 1); + if ($res_r) {//门店调拨短信提醒 + $send_uids = array_unique(array_column($res_r, 'uid')); + $this->send_alisms(['uids' => $send_uids, 'type' => 1, 'item_info' => $item_info]); + } + if ($res_a) {//信息员调拨短信提醒 + $send_admins = array_unique(array_column($res_a, 'uid')); + $this->send_alisms(['uids' => $send_admins, 'type' => 2, 'item_info' => $item_info]); + } + } + return $this->show_json(SYS_CODE_SUCCESS, '短信提醒成功'); + } + /** * 新增/修改调拨 * @return bool diff --git a/admin/views/items/transfer/lists.php b/admin/views/items/transfer/lists.php index bd1d4168..a9377f64 100644 --- a/admin/views/items/transfer/lists.php +++ b/admin/views/items/transfer/lists.php @@ -231,6 +231,7 @@ class="am-btn am-btn-success w100 am-btn-sm">新增 + @@ -240,12 +241,15 @@ + - - + + - - + + @@ -255,6 +259,7 @@ + @@ -673,5 +678,17 @@ }); }); }); + function sendAlisms() { + var ids = function () { + var data = []; + return $(".order-ids").map(function () { + (this.checked) && data.push(this.value); + }), data.join(','); + }.call(this); + if (ids.length < 1) { + return $.msg.tips('请选择需要操作的数据!'); + } + return $.form.modal("/items/transfer/get_send_alisms?ids=" + ids, 'open_type=modal', "短信提醒"); + }
+ + 车辆车架号运输人员车架号运输人员 调拨时间提车人接车人提车人接车人 异常 状态 操作