|
|
|
|
@ -0,0 +1,759 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="tableTop">
|
|
|
|
|
<div>
|
|
|
|
|
<el-input @input="handleSearch" suffix-icon="el-icon-search" style="width: 300px" placeholder="请输入搜索关键字" v-model="input" clearable></el-input>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<el-button @click="handleDeleteMul" type="danger">批量删除</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- 表单 -->
|
|
|
|
|
<el-dialog title="花卉订单详情" :visible.sync="flowerDialogVisible">
|
|
|
|
|
<el-form align="left" ref="FlowerDialogForm" :model="FlowerDialogForm" label-width="150px">
|
|
|
|
|
<el-form-item label="订单号:" prop="order_id">
|
|
|
|
|
{{this.FlowerDialogForm.order_id}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="用户账号:" prop="user_id">
|
|
|
|
|
{{this.FlowerDialogForm.user_id}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="配送方式:" prop="order_method">
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_method===1">送货上门</span>
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_method===0">到店自取</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="订单状态:" prop="order_state">
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_state===0">待支付</span>
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_state===1">待发货</span>
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_state===2">待收货</span>
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_state===3">已收货</span>
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_state===4">待退款</span>
|
|
|
|
|
<span v-show="this.FlowerDialogForm.order_state===5">已退款</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="订单地址:" prop="order_address">
|
|
|
|
|
{{this.FlowerDialogForm.order_address}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="联系电话:" prop="order_phone">
|
|
|
|
|
{{this.FlowerDialogForm.order_phone}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="快递单号:" prop="order_delivery_number">
|
|
|
|
|
{{this.FlowerDialogForm.order_delivery_number}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="下单时间:" prop="order_time">
|
|
|
|
|
{{this.FlowerDialogForm.order_time}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="支付时间:" prop="order_time_pay">
|
|
|
|
|
{{this.FlowerDialogForm.order_time_pay}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="发货时间:" prop="order_time_delivery">
|
|
|
|
|
{{this.FlowerDialogForm.order_time_delivery}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="收货时间:" prop="order_time_receive">
|
|
|
|
|
<span>{{this.FlowerDialogForm.order_time_receive}}</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-table :data="FlowerDialogForm.flowers"
|
|
|
|
|
stripe
|
|
|
|
|
border
|
|
|
|
|
:height="theHeight"
|
|
|
|
|
style="width:100%">
|
|
|
|
|
<el-table-column type="expand">
|
|
|
|
|
<template slot-scope="props">
|
|
|
|
|
<el-form label-position="left" inline class="demo-table-expand">
|
|
|
|
|
<span v-for="pack in props.row.packs">
|
|
|
|
|
<el-form-item label="包装辅料名称:" style="display:block">
|
|
|
|
|
<span>{{ pack.pack_name }}</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="包装辅料单价(元):" style="display:block;margin-top: -20px">
|
|
|
|
|
<span>{{ pack.pack_price.toFixed(2) }}</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</span>
|
|
|
|
|
</el-form>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="flower_id" label="花卉id" width="150"></el-table-column>
|
|
|
|
|
<el-table-column prop="flower_name" label="花卉名称"></el-table-column>
|
|
|
|
|
<el-table-column prop="flower_price" sortable label="花卉单价"></el-table-column>
|
|
|
|
|
<el-table-column prop="number" label="数量"></el-table-column>
|
|
|
|
|
<el-table-column prop="sum" label="小计(元)">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="scope.row.packs!==null">{{scope.row.sum.toFixed(2)}}</div>
|
|
|
|
|
<div v-if="scope.row.packs===null">{{scope.row.sum}}</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- <el-form-item label="优惠套餐:" prop="order_discount_name">-->
|
|
|
|
|
<!-- {{this.FlowerDialogForm.order_discount_name}}-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<!-- <el-form-item label="优惠折扣:" prop="order_discount_num">-->
|
|
|
|
|
<!-- {{this.FlowerDialogForm.order_discount_num}}%-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="运费(元):" prop="trans_fee">
|
|
|
|
|
{{this.FlowerDialogForm.trans_fee}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="订单总金额(元):" prop="order_price">
|
|
|
|
|
{{this.FlowerDialogForm.order_price}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="handleClose">关 闭</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog title="赠品订单详情" :visible.sync="giftDialogVisible">
|
|
|
|
|
<el-form align="left" ref="GiftDialogForm" :model="GiftDialogForm" label-width="150px">
|
|
|
|
|
<el-form-item label="订单号:" prop="order_id">
|
|
|
|
|
{{this.GiftDialogForm.order_id}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="用户账号:" prop="user_id">
|
|
|
|
|
{{this.GiftDialogForm.user_id}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="配送方式:" prop="order_method">
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_method===1">送货上门</span>
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_method===0">到店自取</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="订单状态:" prop="order_state">
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_state===0">待支付</span>
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_state===1">待发货</span>
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_state===2">待收货</span>
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_state===3">已收货</span>
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_state===4">待退款</span>
|
|
|
|
|
<span v-show="this.GiftDialogForm.order_state===5">已退款</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="订单地址:" prop="order_address">
|
|
|
|
|
{{this.GiftDialogForm.order_address}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="联系电话:" prop="order_phone">
|
|
|
|
|
{{this.GiftDialogForm.order_phone}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="快递单号:" prop="order_delivery_number">
|
|
|
|
|
{{this.GiftDialogForm.order_delivery_number}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="下单时间:" prop="order_time">
|
|
|
|
|
{{this.GiftDialogForm.order_time}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="支付时间:" prop="order_time_pay">
|
|
|
|
|
{{this.GiftDialogForm.order_time_pay}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="发货时间:" prop="order_time_delivery">
|
|
|
|
|
{{this.GiftDialogForm.order_time_delivery}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="收货时间:" prop="order_time_receive">
|
|
|
|
|
{{this.GiftDialogForm.order_time_receive}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-table
|
|
|
|
|
:data="GiftDialogForm.gifts" stripe border :height="theHeight" style="width:100%">
|
|
|
|
|
<el-table-column prop="gift_id" label="赠品号" width="150"></el-table-column>
|
|
|
|
|
<el-table-column prop="gift_name" label="赠品名"></el-table-column>
|
|
|
|
|
<el-table-column prop="gift_point" sortable label="赠品兑换积分"></el-table-column>
|
|
|
|
|
<el-table-column prop="number" label="数量"></el-table-column>
|
|
|
|
|
<el-table-column prop="sum" label="小计"></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-form-item label="运费(元):" prop="trans_fee">
|
|
|
|
|
{{this.GiftDialogForm.trans_fee}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="总消耗积分:" prop="order_price">
|
|
|
|
|
{{this.GiftDialogForm.order_price}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="handleClose">关 闭</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
<el-dialog title="发 货" :visible.sync="dialogVisible2" :before-close="handleClose2">
|
|
|
|
|
<el-form align="left" ref="sendOutForm" :rules="rules" :model="sendOutForm" label-width="130px" style="margin-right: 150px">
|
|
|
|
|
<el-form-item label="订单类型:" prop="order_method">
|
|
|
|
|
<span v-show="this.sendOutForm.order_method===1">送货上门</span>
|
|
|
|
|
<span v-show="this.sendOutForm.order_method===0">到店自取</span>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<div v-if="this.sendOutForm.order_method===1">
|
|
|
|
|
<el-form-item label="订单号:" prop="order_id">
|
|
|
|
|
{{this.sendOutForm.order_id}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="订单地址:" prop="order_address">
|
|
|
|
|
{{this.sendOutForm.order_address}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="联系电话:" prop="order_phone">
|
|
|
|
|
{{this.sendOutForm.order_phone}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="快递单号:" prop="order_delivery_number">
|
|
|
|
|
<el-input v-model="sendOutForm.order_delivery_number" placeholder="请输入快递单号"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-if="this.sendOutForm.order_method===0">
|
|
|
|
|
<el-form-item label="订单号:" prop="order_id">
|
|
|
|
|
{{this.sendOutForm.order_id}}
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="sendOut" type="primary">确认发货</el-button>
|
|
|
|
|
<el-button @click="handleClose2">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
<el-table
|
|
|
|
|
ref="multipleTable"
|
|
|
|
|
:data="tableData"
|
|
|
|
|
tooltip-effect="dark"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="60"></el-table-column>
|
|
|
|
|
<el-table-column prop="order_id" label="订单号" width="120"></el-table-column>
|
|
|
|
|
<el-table-column prop="order_type" label="订单类型" width="150"
|
|
|
|
|
:filters="[{ text: '商品订单', value: 0 }, { text: '换赠订单', value:1 }]"
|
|
|
|
|
:filter-method="filterType">>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag
|
|
|
|
|
:type="scope.row.order_type === 0 ? 'primary' : 'success'"
|
|
|
|
|
disable-transitions>
|
|
|
|
|
<span v-show="scope.row.order_type===0">商品订单</span>
|
|
|
|
|
<span v-show="scope.row.order_type===1">换赠订单</span>
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="order_price" label="金额(¥)/积分" width="120"></el-table-column>
|
|
|
|
|
<el-table-column prop="order_time" label="下单时间" width="200"></el-table-column>
|
|
|
|
|
<el-table-column prop="order_time_delivery" label="发货时间" width="200"></el-table-column>
|
|
|
|
|
<el-table-column prop="order_method" label="配送方式" width="150"
|
|
|
|
|
:filters="[{ text: '到店自取', value: 0 }, { text: '送货上门', value:1 }]"
|
|
|
|
|
:filter-method="filterMethod">>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tag
|
|
|
|
|
:type="scope.row.order_method === 0 ? 'primary' : 'success'"
|
|
|
|
|
disable-transitions>
|
|
|
|
|
<span v-show="scope.row.order_method===0">到店自取</span>
|
|
|
|
|
<span v-show="scope.row.order_method===1">送货上门</span>
|
|
|
|
|
</el-tag>
|
|
|
|
|
</template></el-table-column>
|
|
|
|
|
<el-table-column prop="order_state" label="订单状态" width="130"
|
|
|
|
|
:filters="[{ text: '待支付', value: 0 }, { text: '待发货', value:1 },
|
|
|
|
|
{ text: '待收货', value:2 },{ text: '已收货', value:3 },
|
|
|
|
|
{ text: '待退款', value:4 },{ text: '已退款', value:5 }]"
|
|
|
|
|
:filter-method="filterState">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span v-show="scope.row.order_state===0">待支付</span>
|
|
|
|
|
<span v-show="scope.row.order_state===1">
|
|
|
|
|
<el-button @click="handleSendOut(scope.row)" type="text">待发货</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-show="scope.row.order_state===2">待收货</span>
|
|
|
|
|
<span v-show="scope.row.order_state===3">已收货</span>
|
|
|
|
|
<span v-show="scope.row.order_state===4">
|
|
|
|
|
<el-button @click="handleRefund(scope.row)" type="text">待退款</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
<span v-show="scope.row.order_state===5">已退款</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" >
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button @click="handleOpen(scope.row)" type="primary" size="small" plain>查看详情</el-button>
|
|
|
|
|
<el-button @click="handleDelete(scope.row)" type="danger" size="small" plain>删 除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<el-pagination
|
|
|
|
|
background
|
|
|
|
|
:current-page="currentPage"
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
layout="total, prev, pager, next, jumper"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page-count="page_number"
|
|
|
|
|
style="margin-top: 30px"
|
|
|
|
|
@current-change="handleCurrentChange">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import Cookie from "js-cookie";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
//页面数据
|
|
|
|
|
tableData: [{
|
|
|
|
|
order_id: 1,
|
|
|
|
|
user_id: 1,
|
|
|
|
|
order_type: 1,
|
|
|
|
|
order_price: 1.00,
|
|
|
|
|
order_delivery_number:'',
|
|
|
|
|
order_time: '',
|
|
|
|
|
order_time_pay:'',
|
|
|
|
|
order_time_delivery: '',
|
|
|
|
|
order_time_receive: '',
|
|
|
|
|
order_address:'',
|
|
|
|
|
order_phone:'',
|
|
|
|
|
order_state: 1,
|
|
|
|
|
order_method: 1,
|
|
|
|
|
trans_fee:1.00,
|
|
|
|
|
order_discount:1
|
|
|
|
|
}],
|
|
|
|
|
//订单详情表单
|
|
|
|
|
FlowerDialogForm:[{
|
|
|
|
|
order_id: 1,
|
|
|
|
|
user_id: 1,
|
|
|
|
|
order_type: 1,
|
|
|
|
|
order_price: 1.00,
|
|
|
|
|
order_delivery_number:'',
|
|
|
|
|
order_time: '',
|
|
|
|
|
order_time_pay:'',
|
|
|
|
|
order_time_delivery: '',
|
|
|
|
|
order_time_receive: '',
|
|
|
|
|
order_address:'',
|
|
|
|
|
order_phone:'',
|
|
|
|
|
order_state: 1,
|
|
|
|
|
order_method: 1,
|
|
|
|
|
trans_fee:1.00,
|
|
|
|
|
order_discount_name:'',
|
|
|
|
|
order_discount_num:1,
|
|
|
|
|
flowers:[{
|
|
|
|
|
flower_id:1,
|
|
|
|
|
flower_name:'',
|
|
|
|
|
flower_price:0.00,
|
|
|
|
|
number:1,
|
|
|
|
|
sum:1,
|
|
|
|
|
packs:[{
|
|
|
|
|
pack_id:1,
|
|
|
|
|
pack_name:'',
|
|
|
|
|
pack_price:0.00
|
|
|
|
|
}]
|
|
|
|
|
}]
|
|
|
|
|
}],
|
|
|
|
|
theHeight:'',
|
|
|
|
|
GiftDialogForm:[{
|
|
|
|
|
order_id: 1,
|
|
|
|
|
user_id: 1,
|
|
|
|
|
order_type: 1,
|
|
|
|
|
order_price: 1.00,
|
|
|
|
|
order_delivery_number:'',
|
|
|
|
|
order_time: '',
|
|
|
|
|
order_time_pay:'',
|
|
|
|
|
order_time_delivery: '',
|
|
|
|
|
order_time_receive: '',
|
|
|
|
|
order_address:'',
|
|
|
|
|
order_phone:'',
|
|
|
|
|
order_state: 1,
|
|
|
|
|
order_method: 1,
|
|
|
|
|
trans_fee:1.00,
|
|
|
|
|
gifts:[{
|
|
|
|
|
gift_id:1,
|
|
|
|
|
gift_name:'',
|
|
|
|
|
gift_point:1,
|
|
|
|
|
number:1,
|
|
|
|
|
sum:1
|
|
|
|
|
}]
|
|
|
|
|
}],
|
|
|
|
|
//发货表单
|
|
|
|
|
sendOutForm:[{
|
|
|
|
|
order_id:1,
|
|
|
|
|
order_method:1,
|
|
|
|
|
order_address:'',
|
|
|
|
|
order_phone:'',
|
|
|
|
|
order_delivery_number:''
|
|
|
|
|
}],
|
|
|
|
|
//表单校验
|
|
|
|
|
rules:{
|
|
|
|
|
order_delivery_number:[
|
|
|
|
|
{ required:true, trigger:'blur', message:'请输入快递单号'}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
//数据处理
|
|
|
|
|
multipleSelection: [],
|
|
|
|
|
input: '',
|
|
|
|
|
//表单可见控制
|
|
|
|
|
flowerDialogVisible:false, //花卉订单详情
|
|
|
|
|
giftDialogVisible:false, //赠品订单详情
|
|
|
|
|
dialogVisible2:false, //发货表单
|
|
|
|
|
//分页相关
|
|
|
|
|
currentPage:1,
|
|
|
|
|
pageSize:10,
|
|
|
|
|
page_number:1,//总页数
|
|
|
|
|
total:10,//总条数
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.currentPage=1;
|
|
|
|
|
this.fetchData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
fetchData(){
|
|
|
|
|
//获取所有订单信息
|
|
|
|
|
const _this=this;
|
|
|
|
|
try {
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/list',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
page:_this.currentPage,
|
|
|
|
|
page_size:_this.pageSize
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200){
|
|
|
|
|
//查询所有订单信息成功
|
|
|
|
|
_this.tableData=response.data.data.orders;
|
|
|
|
|
_this.page_number=response.data.data.page_number;
|
|
|
|
|
_this.total=response.data.data.total;
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("页面加载出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}catch (error){
|
|
|
|
|
this.$message.warning('页面加载出错,请重试!')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//搜索
|
|
|
|
|
handleSearch(){
|
|
|
|
|
const _this = this
|
|
|
|
|
try {
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/query',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
page:_this.currentPage,
|
|
|
|
|
page_size:_this.pageSize,
|
|
|
|
|
order_id:_this.input
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200){
|
|
|
|
|
//查询所有信息成功
|
|
|
|
|
_this.tableData=response.data.data.orders;
|
|
|
|
|
_this.page_number=response.data.data.page_number;
|
|
|
|
|
_this.total=response.data.data.total;
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("页面加载出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}catch (error){
|
|
|
|
|
this.$message.warning('页面加载出错,请重试!')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//分页
|
|
|
|
|
handleCurrentChange(page) {
|
|
|
|
|
this.currentPage = page;
|
|
|
|
|
this.fetchData();
|
|
|
|
|
},
|
|
|
|
|
//多选
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
|
|
this.multipleSelection = val;
|
|
|
|
|
},
|
|
|
|
|
//表格筛选相关
|
|
|
|
|
filterType(value, row) {
|
|
|
|
|
return row.order_type === value;
|
|
|
|
|
},
|
|
|
|
|
filterMethod(value, row) {
|
|
|
|
|
return row.order_method === value;
|
|
|
|
|
},
|
|
|
|
|
filterState(value, row) {
|
|
|
|
|
return row.order_state === value;
|
|
|
|
|
},
|
|
|
|
|
//删除
|
|
|
|
|
handleDelete(row){
|
|
|
|
|
const _this = this;
|
|
|
|
|
this.$confirm('此操作将永久删除该订单信息, 是否继续?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
//确认删除
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/deletePer',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
order_id:row.order_id
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200) {
|
|
|
|
|
//删除成功
|
|
|
|
|
_this.handleSearch()
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("页面加载出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$message({type: 'success', message: '删除成功!'});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message({type: 'info', message: '已取消删除'});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleDeleteMul(){
|
|
|
|
|
const _this = this
|
|
|
|
|
if(_this.multipleSelection.length===0)
|
|
|
|
|
this.$message({type: 'warning', message: '请选择订单'});
|
|
|
|
|
else{
|
|
|
|
|
let ids = []
|
|
|
|
|
for (let i=0; i<_this.multipleSelection.length; i++){
|
|
|
|
|
ids[i] = _this.multipleSelection[i].order_id
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.$confirm('此操作将永久删除订单信息, 是否继续?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
//确认删除
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/deleteMul',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
order_ids:ids
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200) {
|
|
|
|
|
//删除成功
|
|
|
|
|
_this.handleSearch()
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("任务出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$message({type: 'success', message: '批量删除成功!'});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message({type: 'info', message: '已取消删除'});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//订单详情
|
|
|
|
|
handleOpen(row){
|
|
|
|
|
const _this=this;
|
|
|
|
|
if(row.order_type === 0){ //花卉订单详情
|
|
|
|
|
this.flowerDialogVisible = true;
|
|
|
|
|
try {
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/detail/flower',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
order_id: row.order_id
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200){
|
|
|
|
|
_this.FlowerDialogForm=response.data.data;
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("页面加载出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}catch (error){
|
|
|
|
|
this.$message.warning('页面加载出错,请重试!')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(row.order_type === 1){ //赠品订单详情
|
|
|
|
|
this.giftDialogVisible = true;
|
|
|
|
|
this.GiftDialogForm.order_id = row.order_id
|
|
|
|
|
try {
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/detail/gift',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
order_id: row.order_id
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200){
|
|
|
|
|
_this.GiftDialogForm=response.data.data;
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("页面加载出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}catch (error){
|
|
|
|
|
this.$message.warning('页面加载出错,请重试!')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleClose(){
|
|
|
|
|
this.flowerDialogVisible = false;
|
|
|
|
|
this.giftDialogVisible = false;
|
|
|
|
|
},
|
|
|
|
|
//发货
|
|
|
|
|
handleSendOut(row){
|
|
|
|
|
this.dialogVisible2 = true;
|
|
|
|
|
this.sendOutForm.order_id = row.order_id
|
|
|
|
|
this.sendOutForm.order_method = row.order_method
|
|
|
|
|
this.sendOutForm.order_address = row.order_address
|
|
|
|
|
this.sendOutForm.order_phone = row.order_phone
|
|
|
|
|
},
|
|
|
|
|
sendOut(){
|
|
|
|
|
const _this=this;
|
|
|
|
|
if(_this.sendOutForm.order_delivery_number === undefined)
|
|
|
|
|
_this.sendOutForm.order_delivery_number = '1';
|
|
|
|
|
this.$refs.sendOutForm.validate((valid) =>{
|
|
|
|
|
if(valid){
|
|
|
|
|
//提交发货表单
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/modify',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
order_id:_this.sendOutForm.order_id,
|
|
|
|
|
state:2, //发货
|
|
|
|
|
order_delivery_number:_this.sendOutForm.order_delivery_number
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200) {
|
|
|
|
|
//添加信息成功
|
|
|
|
|
_this.$message.success('发货成功!')
|
|
|
|
|
//再次获取数据以更新页面
|
|
|
|
|
_this.fetchData()
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("任务出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//清空表单数据
|
|
|
|
|
_this.handleClose2();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
handleClose2(){
|
|
|
|
|
this.dialogVisible2 = false;
|
|
|
|
|
this.sendOutForm.order_id = 1;
|
|
|
|
|
this.sendOutForm.order_method = 1;
|
|
|
|
|
this.sendOutForm.order_delivery_number = '';
|
|
|
|
|
},
|
|
|
|
|
//退款
|
|
|
|
|
handleRefund(row){
|
|
|
|
|
const _this = this;
|
|
|
|
|
const h = this.$createElement //提示框换行
|
|
|
|
|
this.$confirm(h('div', [h('p', '退款单号:'+row.order_id),
|
|
|
|
|
h('p', '退款金额:'+row.order_price+'元'),
|
|
|
|
|
h('p', '是否继续退款?')]), '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
//确认删除
|
|
|
|
|
axios({
|
|
|
|
|
method: 'post',
|
|
|
|
|
url: 'http://localhost:8181/order/modify',
|
|
|
|
|
headers: {
|
|
|
|
|
Authorization: Cookie.get('token'),
|
|
|
|
|
'Content-Type': 'application/json'
|
|
|
|
|
},
|
|
|
|
|
data:{
|
|
|
|
|
order_id:row.order_id,
|
|
|
|
|
state:5, //退款
|
|
|
|
|
order_delivery_number:''
|
|
|
|
|
}
|
|
|
|
|
}).then(function (response){
|
|
|
|
|
if (response.data.code===200) {
|
|
|
|
|
//退款成功
|
|
|
|
|
_this.handleSearch()
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===401){
|
|
|
|
|
_this.$message.warning('身份验证失败,请重新登录!')
|
|
|
|
|
}
|
|
|
|
|
if (response.data.code===403){
|
|
|
|
|
const message = response.data.msg;
|
|
|
|
|
this.$alert("页面加载出错,具体原因如下:\n"+message, '页面加载失败', {
|
|
|
|
|
confirmButtonText: '确定'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$message({type: 'success', message: '退款成功!'});
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.$message({type: 'info', message: '已取消退款'});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.tableTop{
|
|
|
|
|
width: 1200px;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin: 10px 0 20px 50px;
|
|
|
|
|
}
|
|
|
|
|
.avatar-uploader .el-upload {
|
|
|
|
|
border: 1px dashed #d9d9d9;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
position: relative;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.avatar-uploader .el-upload:hover {
|
|
|
|
|
border-color: #409EFF;
|
|
|
|
|
}
|
|
|
|
|
.avatar-uploader-icon {
|
|
|
|
|
font-size: 30px;
|
|
|
|
|
color: #8c939d;
|
|
|
|
|
width: 150px;
|
|
|
|
|
height: 100px;
|
|
|
|
|
line-height: 150px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
padding-top: 50px;
|
|
|
|
|
}
|
|
|
|
|
.avatar {
|
|
|
|
|
width: 150px;
|
|
|
|
|
height: 150px;
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|