直连接单

This commit is contained in:
jianghanbo 2024-12-02 18:43:20 +08:00
parent e3c08391b7
commit c067dddd8e
6 changed files with 112 additions and 19 deletions

View File

@ -186,7 +186,7 @@
v-if="scope.row.is_direct_mode && scope.row.appointment_status == 1" v-if="scope.row.is_direct_mode && scope.row.appointment_status == 1"
size="small" size="small"
icon="el-icon-thumb" icon="el-icon-thumb"
@click="dyOrderConfirm(scope.row)" @click="confirmOrder(scope.row)"
> >
确认接单 确认接单
</el-button> </el-button>
@ -570,6 +570,81 @@
</el-tabs> </el-tabs>
</el-dialog> </el-dialog>
<el-dialog title="确认接单" :visible.sync="orderConfirmDialogVisible">
<el-form label-width="130px" :model="item">
<el-form-item label="产品名称">
{{ item.product_name }}
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="产品状态">
{{ item.order_status_name }}
</el-form-item>
<el-form-item label="数量">
{{ item.quantity }}
</el-form-item>
<el-form-item label="手机">
{{ item.mobile }}
</el-form-item>
<el-form-item label="下单时间">
{{ item.create_at | parseTime("{y}-{m}-{d} {h}:{i}") }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="item.dyOrderAppointments.number_of_guests" label="人员">
<el-row>
<el-col :span="3">大人</el-col>
<el-col :span="5"
><el-input
v-model="item.dyOrderAppointments.number_of_guests.adult"
name="adult"
placeholder="大人"
/></el-col>
<el-col :span="3">小孩</el-col>
<el-col :span="5"
><el-input
v-model="item.dyOrderAppointments.number_of_guests.child"
name="child"
placeholder="小孩"
/></el-col>
</el-row>
</el-form-item>
<el-form-item label="出游日期">
{{ item.dyOrderAppointments.book_info.book_start_date }}
</el-form-item>
<el-form-item label="返回日期">
{{ item.dyOrderAppointments.book_info.book_end_date }}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="预约详情">
<el-table
v-if="item.dyOrderAppointments.book_info.occupancies"
:data="item.dyOrderAppointments.book_info.occupancies"
style="width: 100%;margin-bottom: 0;">
<el-table-column
prop="name"
label="出行人"
width="180">
</el-table-column>
<el-table-column
prop="license_id"
label="证件号"
width="180">
</el-table-column>
</el-table>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="dyOrderConfirm(item, 1)">确认接单</el-button>
<el-button type="primary" @click="dyOrderConfirm(item, 2)">拒绝</el-button>
</div>
</el-dialog>
<el-dialog title="纯核销" :visible.sync="dialog2Visible"> <el-dialog title="纯核销" :visible.sync="dialog2Visible">
<el-form label-width="160px" :model="form"> <el-form label-width="160px" :model="form">
<el-form-item label="平台"> <el-form-item label="平台">
@ -692,12 +767,13 @@ export default {
os_status: [], os_status: [],
appointment_status: "", appointment_status: "",
}, },
item: { next_follow: "", personnel: { adult: "" } }, item: { next_follow: "", personnel: { adult: "" }, dyOrderAppointments:{book_info:{}} },
follow: [], follow: [],
dialogVisible: false, dialogVisible: false,
dialog2Visible: false, dialog2Visible: false,
applyVisible: false, applyVisible: false,
orderConfirmDialogVisible:false,
oss: [], oss: [],
isSynchronization: false, isSynchronization: false,
item3: { item3: {
@ -854,6 +930,15 @@ export default {
}) })
.catch((err) => {}); .catch((err) => {});
}, },
confirmOrder(item) {
this.$axios
.get("/admin/order/info", { params: { id: item.id } })
.then((res) => {
this.item = res.data;
this.orderConfirmDialogVisible = true;
})
.catch((err) => {});
},
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
}, },
@ -1039,16 +1124,17 @@ export default {
}); });
}); });
}, },
dyOrderConfirm(item) { dyOrderConfirm(item, confirm_result) {
this.$axios this.$axios
.post("/admin/order/dyOrderConfirm", { id: item.id }) .post("/admin/order/dyOrderConfirm", { id: item.id, confirm_result:confirm_result })
.then((res) => { .then((res) => {
this.$notify({ this.$notify({
title: "成功", title: "成功",
message: "接单成功", message: "操作成功",
type: "success", type: "success",
}); });
// this.getList(); this.orderConfirmDialogVisible = false;
this.getList();
}) })
.catch((err) => { .catch((err) => {
this.$notify.error({ this.$notify.error({

View File

@ -242,7 +242,7 @@ class OrderController extends base
if($request->admin->is_super == 0) { if($request->admin->is_super == 0) {
$where[] = ['admin_id','=',$request->admin->id]; $where[] = ['admin_id','=',$request->admin->id];
} }
$item = Orders::where($where)->with(['follow.admin','finance'])->find(); $item = Orders::where($where)->with(['follow.admin','finance', 'dyOrderAppointments'])->find();
if(empty($item)) { if(empty($item)) {
return $this->error(2002, '订单没有找到或者已经转移到其他人'); return $this->error(2002, '订单没有找到或者已经转移到其他人');
@ -714,11 +714,13 @@ class OrderController extends base
return $this->error(2004, '记录没有找到.'); return $this->error(2004, '记录没有找到.');
} }
// 1接单 2拒单 // 1接单 2拒单
// if (!$request->post('confirm_result') || !in_array($request->post('confirm_result'), [1, 2])) { if (!$request->post('confirm_result') || !in_array($request->post('confirm_result'), [1, 2])) {
// return $this->error(2005, '确认状态错误'); return $this->error(2005, '确认状态错误');
// } }
// 抖音预约信息 $confirmResult = $request->post('confirm_result', 1);
$appoint = DyOrderProductAppointments::query()->where(['source_order_id' => $order['sn']])->find();
// 抖音预约信息z
$appoint = DyOrderProductAppointments::query()->where(['source_order_id' => $order['sn']])->order('id desc')->find();
if (empty($appoint)) { if (empty($appoint)) {
return $this->error(2004, '该订单暂未预约,不可接单'); return $this->error(2004, '该订单暂未预约,不可接单');
} }
@ -739,7 +741,7 @@ class OrderController extends base
'order_id' => $appoint->dy_order_id, 'order_id' => $appoint->dy_order_id,
'source_order_id' => $appoint->source_order_id, 'source_order_id' => $appoint->source_order_id,
'confirm_info' => [ 'confirm_info' => [
'confirm_result' => $request->post('confirm_result', 1), 'confirm_result' => $confirmResult,
'reject_code' => $request->post('reject_code'), // 1: 库存已约满 2商品需加价 3无法满足顾客需求 'reject_code' => $request->post('reject_code'), // 1: 库存已约满 2商品需加价 3无法满足顾客需求
// 'hotel_info' => [], // 境内住宿类目/酒景套餐 必填 // 'hotel_info' => [], // 境内住宿类目/酒景套餐 必填
// 'play_info' => [], // 境内游玩类目 必填 // 'play_info' => [], // 境内游玩类目 必填
@ -748,7 +750,7 @@ class OrderController extends base
]; ];
// 自由行必填参数 // 自由行必填参数
$dyApiService = new DyApiService(); $dyApiService = new DyApiService();
if (in_array($dyOrderProduct->category_id, $zyxCategoryIds)) { if ($confirmResult == 1 && in_array($dyOrderProduct->category_id, $zyxCategoryIds)) {
$onedayTourList = []; $onedayTourList = [];
foreach ($dyOrderProduct->travel_details as $k => $travel_detail) { foreach ($dyOrderProduct->travel_details as $k => $travel_detail) {
array_push($onedayTourList, [ array_push($onedayTourList, [
@ -759,7 +761,7 @@ class OrderController extends base
} }
$confirmData['confirm_info']['free_travel_info']['oneday_tour_list'] = $onedayTourList; $confirmData['confirm_info']['free_travel_info']['oneday_tour_list'] = $onedayTourList;
} }
if (in_array($dyOrderProduct->category_id, $jnCategoryIds)) { if ($confirmResult == 1 && in_array($dyOrderProduct->category_id, $jnCategoryIds)) {
// 获取poi信息 // 获取poi信息
$poiRes = $dyApiService->send(DyApiService::POI_QUERY, ['order_id' => $order->sn, 'account_id' => env('DY_ACCOUNT_ID')]); $poiRes = $dyApiService->send(DyApiService::POI_QUERY, ['order_id' => $order->sn, 'account_id' => env('DY_ACCOUNT_ID')]);
$payInfo = [ $payInfo = [

View File

@ -179,6 +179,11 @@ class Orders extends base
return $this->belongsTo(Products::class, 'product_id', 'third_product_id'); return $this->belongsTo(Products::class, 'product_id', 'third_product_id');
} }
public function dyOrderAppointments()
{
return $this->belongsTo(DyOrderProductAppointments::class, 'sn', 'source_order_id');
}
public static function fish($id, $admin_id) public static function fish($id, $admin_id)
{ {
return Db::transaction(function () use ($id, $admin_id) { return Db::transaction(function () use ($id, $admin_id) {

View File

@ -499,7 +499,7 @@ class Douyin
'Content-type: application/json' 'Content-type: application/json'
]; ];
if ($method == 'GET' || $method == 'POST') { if ($method == 'GET' || $method == 'POST') {
$header[] = 'x-secsdk-csrf-token: ' . $this->_token('', $this->os); $header[] = 'x-secsdk-csrf-token: ' . $this->_token('');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
} else { } else {
curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_HEADER, 1);

View File

@ -164,9 +164,9 @@ class Meituan {
Log::info('http:' . $http); Log::info('http:' . $http);
Log::info('body:' . $body); Log::info('body:' . $body);
// if ($this->tryTimes > 1) { if ($this->tryTimes > 1) {
(new ThirdApiService())->weComNotice($this->os); (new ThirdApiService())->weComNotice($this->os);
// } }
$this->tryTimes++; $this->tryTimes++;
} }
return $res; return $res;