|
|
@@ -36,9 +36,10 @@
|
|
|
|
|
|
<el-table-column align="center" label="物流渠道" prop="shipChannel" />
|
|
|
|
|
|
- <el-table-column align="center" label="操作" width="200" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column align="center" label="操作" width="250" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button v-permission="['GET /admin/order/detail']" type="primary" size="mini" @click="handleDetail(scope.row)">详情</el-button>
|
|
|
+ <el-button v-permission="['POST /admin/order/delete']" type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
<el-button v-if="scope.row.orderStatus==201" v-permission="['POST /admin/order/ship']" type="primary" size="mini" @click="handleShip(scope.row)">发货</el-button>
|
|
|
<el-button v-if="scope.row.orderStatus==202||scope.row.orderStatus==204" v-permission="['POST /admin/order/refund']" type="primary" size="mini" @click="handleRefund(scope.row)">退款</el-button>
|
|
|
</template>
|
|
|
@@ -152,7 +153,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { detailOrder, listOrder, listChannel, refundOrder, shipOrder } from '@/api/order'
|
|
|
+import { detailOrder, listOrder, listChannel, refundOrder, deleteOrder, shipOrder } from '@/api/order'
|
|
|
import Pagination from '@/components/Pagination' // Secondary package based on el-pagination
|
|
|
import checkPermission from '@/utils/permission' // 权限判断函数
|
|
|
|
|
|
@@ -310,6 +311,20 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ handleDelete(row) {
|
|
|
+ deleteOrder({ orderId: row.id }).then(response => {
|
|
|
+ this.$notify.success({
|
|
|
+ title: '成功',
|
|
|
+ message: '订单删除成功'
|
|
|
+ })
|
|
|
+ this.getList()
|
|
|
+ }).catch(response => {
|
|
|
+ this.$notify.error({
|
|
|
+ title: '失败',
|
|
|
+ message: response.data.errmsg
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
handleRefund(row) {
|
|
|
this.refundForm.orderId = row.id
|
|
|
this.refundForm.refundMoney = row.actualPrice
|