后台增加客服预约订单管理
parent
ccd387f5da
commit
02557274e5
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\API\Admin\YeWu;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class YuYueOrderController extends Controller
|
||||||
|
{
|
||||||
|
public function GetList()
|
||||||
|
{
|
||||||
|
$page = request('page');
|
||||||
|
$pageSize = request('pageSize');
|
||||||
|
$searchInfo = request('searchInfo');
|
||||||
|
$list=DB::table('orders_yuyue');
|
||||||
|
if(isset($searchInfo['name'])){
|
||||||
|
$list = $list->where('name', 'like', '%' . $searchInfo['name'] . '%');
|
||||||
|
}
|
||||||
|
if(isset($searchInfo['id_number'])){
|
||||||
|
$list = $list->where('id_number', $searchInfo['id_number'] );
|
||||||
|
}
|
||||||
|
if(isset($searchInfo['order_number'])){
|
||||||
|
$list = $list->where('order_number', $searchInfo['order_number'] );
|
||||||
|
}
|
||||||
|
$count=$list->count();
|
||||||
|
$list=$list->orderBy('id','desc')
|
||||||
|
->skip(($page-1)*$pageSize) // 跳过前9999条记录
|
||||||
|
->take($pageSize)->get();
|
||||||
|
return \Yz::Return(true,"查询完成",['list'=>$list,'count'=>$count]);
|
||||||
|
}
|
||||||
|
public function GetDetail()
|
||||||
|
{
|
||||||
|
$id = request('id');
|
||||||
|
$order=DB::table('orders_yuyue')->where(['id'=>$id])->first();
|
||||||
|
return \Yz::Return(true,"查询完成",['info'=>$order]);
|
||||||
|
}
|
||||||
|
public function Save()
|
||||||
|
{
|
||||||
|
$info = request('info');
|
||||||
|
$date=[
|
||||||
|
'note'=>$info['note']
|
||||||
|
];
|
||||||
|
$u=DB::table('orders_yuyue')->where(['id'=>$info['id']])->update($date);
|
||||||
|
if($u){
|
||||||
|
return \Yz::Return(true,"操作完成",[]);
|
||||||
|
}else{
|
||||||
|
return \Yz::echoError1("保存失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,208 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="head">
|
||||||
|
<el-row>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="searchInfo.name" placeholder="姓名" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="searchInfo.id_number" placeholder="身份证" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item>
|
||||||
|
<el-input v-model="searchInfo.order_number" placeholder="订单号" />
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" style="margin-left: 10px;" @click="GetList()">搜索</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<el-table :data="tableData" style="width: 100%;" row-key="id" v-loading="loading">
|
||||||
|
<el-table-column prop="name" label="姓名" width="100" />
|
||||||
|
<el-table-column prop="id_number" label="身份证" width="160" />
|
||||||
|
<el-table-column prop="phone" label="电话" />
|
||||||
|
<!-- <el-table-column prop="order_number" label="订单号" /> -->
|
||||||
|
<el-table-column prop="title" label="订单名称" />
|
||||||
|
<el-table-column prop="type" label="类型">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.type==1" style="color: #409EFF;">个检</span>
|
||||||
|
<span v-if="scope.row.type==2" style="color: #E6A23C;">团检</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" label="金额" />
|
||||||
|
<!-- <el-table-column prop="order_number" label="状态">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.status==1" style="color: #409EFF;">待支付</span>
|
||||||
|
<span v-if="scope.row.status==2" style="color: #E6A23C;">已预约</span>
|
||||||
|
<span v-if="scope.row.status==3" style="color: #909399;">交易关闭</span>
|
||||||
|
<span v-if="scope.row.status==4" style="color: #67C23A;">已完成</span>
|
||||||
|
<span v-if="scope.row.status==5" style="color: #F56C6C;">已退款</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="check_status" label="到检状态">
|
||||||
|
<template #default="scope">
|
||||||
|
<span v-if="scope.row.check_status==1" style="color: #ffb682;">待检</span>
|
||||||
|
<span v-if="scope.row.check_status==2" style="color: #9dd978;">已到检</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column prop="created_at" label="创建时间" width="180" />
|
||||||
|
<el-table-column label="操作" width="100">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" @click="EditFunc(scope.row)" :icon="Edit" circle />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="page">
|
||||||
|
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
|
||||||
|
:page-sizes="[15, 50, 100, 200]" layout="total,sizes, prev, pager, next" :total="total"
|
||||||
|
@size-change="PageSizeChange" @current-change="PageCurrentChange" />
|
||||||
|
</div>
|
||||||
|
<el-dialog v-model="dialogVisible" title="订单详情">
|
||||||
|
<div class="chuansuokuang" v-loading="loading">
|
||||||
|
<el-form v-if="Info" :model="Info" label-width="100" style="max-width: 600px">
|
||||||
|
<el-form-item label="姓名:">
|
||||||
|
{{Info.name}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="电话:">
|
||||||
|
{{Info.phone}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="身份证:">
|
||||||
|
{{Info.id_number}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单名称:">
|
||||||
|
{{Info.title}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型:">
|
||||||
|
<span v-if="Info.type==1">个检</span><span v-if="Info.type==2">团检</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="实付金额:">
|
||||||
|
{{Info.true_price}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="使用积分:">
|
||||||
|
{{Info.jifen}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预存款抵扣:">
|
||||||
|
{{Info.yucunkuan}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="订单状态:">
|
||||||
|
<span v-if="Info.status==1" style="color: #409EFF;">待支付</span>
|
||||||
|
<span v-if="Info.status==2" style="color: #E6A23C;">已预约</span>
|
||||||
|
<span v-if="Info.status==3" style="color: #909399;">交易关闭</span>
|
||||||
|
<span v-if="Info.status==4" style="color: #67C23A;">已完成</span>
|
||||||
|
<span v-if="Info.status==5" style="color: #F56C6C;">已退款</span>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="到检状态:">
|
||||||
|
<span v-if="Info.status==1" style="color: #ffb682;">待检</span>
|
||||||
|
<span v-if="Info.status==2" style="color: #9dd978;">已到检</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="Info.pay_time" label="支付时间:">
|
||||||
|
{{Info.pay_time}}
|
||||||
|
</el-form-item> -->
|
||||||
|
<el-form-item v-if="Info.appointment_date" label="预约时间:">
|
||||||
|
{{Info.appointment_date}} {{Info.appointment_time}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注:">
|
||||||
|
<el-input v-model="Info.note" :rows="3" type="textarea" placeholder="备注信息" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<span class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="Save()">
|
||||||
|
确定
|
||||||
|
</el-button>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {
|
||||||
|
ref,
|
||||||
|
onMounted
|
||||||
|
} from 'vue'
|
||||||
|
import {
|
||||||
|
ElMessage
|
||||||
|
} from 'element-plus'
|
||||||
|
import {
|
||||||
|
YuYueOrderGetList,
|
||||||
|
YuYueOrderGetDetail,
|
||||||
|
YuYueOrderSave
|
||||||
|
} from '@/api/api.js'
|
||||||
|
import {
|
||||||
|
Edit
|
||||||
|
} from '@element-plus/icons-vue'
|
||||||
|
|
||||||
|
|
||||||
|
let loading = ref(false)
|
||||||
|
let tableData = ref([])
|
||||||
|
let currentPage = ref(1) //当前页码
|
||||||
|
let pageSize = ref(15) //每页数量
|
||||||
|
let total = 0 //总数量
|
||||||
|
const PageSizeChange = (e) => { // 修改每页数量
|
||||||
|
pageSize.value = e
|
||||||
|
GetList()
|
||||||
|
}
|
||||||
|
const PageCurrentChange = (e) => { //切换页码
|
||||||
|
currentPage.value = e
|
||||||
|
GetList()
|
||||||
|
}
|
||||||
|
let searchInfo = ref({})
|
||||||
|
const GetList = () => {
|
||||||
|
loading.value = true
|
||||||
|
YuYueOrderGetList({
|
||||||
|
page: currentPage.value,
|
||||||
|
pageSize: pageSize.value,
|
||||||
|
searchInfo: searchInfo.value
|
||||||
|
}).then(res => {
|
||||||
|
loading.value = false
|
||||||
|
if (res.status) {
|
||||||
|
tableData.value = res.data.list
|
||||||
|
total = res.data.count
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let dialogVisible = ref(false);
|
||||||
|
let Info = ref(null);
|
||||||
|
const EditFunc = (row) => {
|
||||||
|
dialogVisible.value = true
|
||||||
|
GetDetailFunc(row.id)
|
||||||
|
}
|
||||||
|
const GetDetailFunc = (id) => {
|
||||||
|
loading.value = true
|
||||||
|
YuYueOrderGetDetail({
|
||||||
|
id: id
|
||||||
|
}).then(res => {
|
||||||
|
loading.value = false
|
||||||
|
Info.value = res.data.info
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const Save = () => {
|
||||||
|
loading.value = true
|
||||||
|
YuYueOrderSave({
|
||||||
|
info: Info.value
|
||||||
|
}).then(res => {
|
||||||
|
loading.value = false
|
||||||
|
if(res.status){
|
||||||
|
ElMessage({
|
||||||
|
message: '保存成功',
|
||||||
|
type: 'success',
|
||||||
|
})
|
||||||
|
dialogVisible.value = false
|
||||||
|
}else{
|
||||||
|
ElMessage.error(res.msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
GetList()
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue