|
@@ -86,9 +86,10 @@
|
|
"></el-table-column>
|
|
"></el-table-column>
|
|
<el-table-column label="结账时间" prop="checkoutTime"></el-table-column>
|
|
<el-table-column label="结账时间" prop="checkoutTime"></el-table-column>
|
|
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
|
<el-table-column label="创建时间" prop="createTime"></el-table-column>
|
|
- <el-table-column label="操作" width="120" fixed="right">
|
|
|
|
|
|
+ <el-table-column label="操作" width="200" fixed="right">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<el-button type="primary" link @click="showDetail(row)">查看已点菜品</el-button>
|
|
<el-button type="primary" link @click="showDetail(row)">查看已点菜品</el-button>
|
|
|
|
+ <el-button v-if="row.status=='2'" type="danger" link @click="refund(row)">退款</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -96,6 +97,27 @@
|
|
<pagination v-model="pager" @change="getLists" />
|
|
<pagination v-model="pager" @change="getLists" />
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
|
|
+ <el-dialog
|
|
|
|
+ v-model="refundDialogVisible"
|
|
|
|
+ title="退款"
|
|
|
|
+ width="400px"
|
|
|
|
+ @close="refundDialogVisible = false">
|
|
|
|
+ <div class="refund-dialog-content">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="refundAmount"
|
|
|
|
+ placeholder="请输入退款金额"
|
|
|
|
+ type="number">
|
|
|
|
+ <template #prepend><icon :size="25" name="el-icon-money" /></template>
|
|
|
|
+ <template #append>元</template>
|
|
|
|
+ </el-input>
|
|
|
|
+ </div>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
+ <el-button @click="refundDialogVisible = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="confirmRefund">确 定</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -142,6 +164,31 @@
|
|
showDetail(row);
|
|
showDetail(row);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ // 添加这些变量到组件顶层
|
|
|
|
+ const refundDialogVisible = ref(false)
|
|
|
|
+ const refundAmount = ref(0)
|
|
|
|
+
|
|
|
|
+ // 修改refund函数
|
|
|
|
+ const refund = async (row: any) => {
|
|
|
|
+ refundDialogVisible.value = true
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const confirmRefund = async () => {
|
|
|
|
+ // try {
|
|
|
|
+ // const res = await processRefund({ id: row.id, amount: refundAmount.value })
|
|
|
|
+ // if (res.success) {
|
|
|
|
+ // feedback.msgSuccess('退款成功')
|
|
|
|
+ // } else {
|
|
|
|
+ // feedback.msgError('退款失败')
|
|
|
|
+ // }
|
|
|
|
+ // } catch (error) {
|
|
|
|
+ // console.error('退款失败:', error)
|
|
|
|
+ // feedback.msgError('退款失败')
|
|
|
|
+ // } finally {
|
|
|
|
+ // refundDialogVisible.value = false
|
|
|
|
+ // }
|
|
|
|
+ }
|
|
|
|
+
|
|
// 展示订单详情
|
|
// 展示订单详情
|
|
const showDetail = async (row : any) => {
|
|
const showDetail = async (row : any) => {
|
|
try {
|
|
try {
|
|
@@ -243,4 +290,20 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .refund-dialog-content {
|
|
|
|
+ padding: 20px 0px;
|
|
|
|
+
|
|
|
|
+ :deep(.el-input) {
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .dialog-footer {
|
|
|
|
+ text-align: right;
|
|
|
|
+
|
|
|
|
+ .el-button + .el-button {
|
|
|
|
+ margin-left: 12px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|