|
|
@@ -50,7 +50,8 @@
|
|
|
<span v-else-if="scope.row.status === '3'" class="txt-cell-green">已入住</span>
|
|
|
<span v-else-if="scope.row.status === '4'" class="txt-cell-red">已取消</span>
|
|
|
<span v-else-if="scope.row.status === '5'" class="txt-cell-red">已退款</span>
|
|
|
- <span v-else class="txt-cell-red">已退房</span>
|
|
|
+ <span v-else-if="scope.row.status === '6'" class="txt-cell-red">已退房</span>
|
|
|
+ <span v-else class="txt-cell-red">未知</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="房间" align="center">
|
|
|
@@ -85,9 +86,9 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="300">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button size="mini" round type="primary" @click="collate_refund_checkout_handler(scope.$index, scope.row, 1)">核销</el-button>
|
|
|
- <el-button size="mini" round type="danger" @click="collate_refund_checkout_handler(scope.$index, scope.row, 2)">退款</el-button>
|
|
|
- <el-button size="mini" round type="warning" @click="collate_refund_checkout_handler(scope.$index, scope.row, 3)">退房</el-button>
|
|
|
+ <el-button size="mini" round type="primary" @click="collate_handler(scope.$index, scope.row)">核销</el-button>
|
|
|
+ <el-button size="mini" round type="danger" @click="refund_handler(scope.$index, scope.row)">退款</el-button>
|
|
|
+ <el-button size="mini" round type="warning" @click="checkout_handler(scope.$index, scope.row)">退房</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -106,7 +107,9 @@
|
|
|
<script>
|
|
|
import {
|
|
|
getTableData,
|
|
|
- collate_refund_checkout,
|
|
|
+ collate,
|
|
|
+ refund,
|
|
|
+ checkout,
|
|
|
downloadExcel
|
|
|
} from '@/api/order'
|
|
|
export default {
|
|
|
@@ -153,19 +156,91 @@
|
|
|
},
|
|
|
methods: {
|
|
|
/**
|
|
|
- * 核销 退款 退房
|
|
|
+ * 核销
|
|
|
*/
|
|
|
- collate_refund_checkout_handler(index, row, param) {
|
|
|
- // console.log(index, row, row.status, param);
|
|
|
- var txt = '';
|
|
|
- if (param === 1) {
|
|
|
- txt = '核销';
|
|
|
- } else if (param === 2) {
|
|
|
- txt = '退款';
|
|
|
- } else {
|
|
|
- txt = '退房';
|
|
|
- }
|
|
|
- this.$confirm('确定' + txt + '?', '提示', {
|
|
|
+ collate_handler(index, row) {
|
|
|
+ // console.log(index, row, row.status);
|
|
|
+ this.$confirm('确定核销?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ closeOnClickModal: false
|
|
|
+ }).then(() => {
|
|
|
+ let data = {
|
|
|
+ id: row.id,
|
|
|
+ status: 3,
|
|
|
+ dom: row.dom
|
|
|
+ };
|
|
|
+ // console.log(data);
|
|
|
+ collate(data).then((res) => {
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.message
|
|
|
+ });
|
|
|
+ // 刷新列表
|
|
|
+ this.get_table_data('pages');
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ // console.log(err);
|
|
|
+ this.$message.error(err.message)
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消核销'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 退款
|
|
|
+ */
|
|
|
+ refund_handler(index, row, param) {
|
|
|
+ // console.log(index, row, row.status);
|
|
|
+ this.$confirm('确定退款?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ closeOnClickModal: false
|
|
|
+ }).then(() => {
|
|
|
+ let data = {
|
|
|
+ id: row.id,
|
|
|
+ status: 5,
|
|
|
+ dom: row.dom
|
|
|
+ };
|
|
|
+ // console.log(data);
|
|
|
+ refund(data).then((res) => {
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.message
|
|
|
+ });
|
|
|
+ // 刷新列表
|
|
|
+ this.get_table_data('pages');
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.message)
|
|
|
+ }
|
|
|
+ }).catch((err) => {
|
|
|
+ // console.log(err);
|
|
|
+ this.$message.error(err.message)
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'info',
|
|
|
+ message: '已取消退款'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 退房
|
|
|
+ */
|
|
|
+ checkout_handler(index, row) {
|
|
|
+ // console.log(index, row, row.status);
|
|
|
+ this.$confirm('确定退房?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning',
|
|
|
@@ -173,17 +248,19 @@
|
|
|
}).then(() => {
|
|
|
let data = {
|
|
|
id: row.id,
|
|
|
- status: row.status,
|
|
|
+ status: 6,
|
|
|
dom: row.dom
|
|
|
};
|
|
|
// console.log(data);
|
|
|
- collate_refund_checkout(data).then((res) => {
|
|
|
+ checkout(data).then((res) => {
|
|
|
// console.log(res);
|
|
|
if (res.code === 200) {
|
|
|
this.$message({
|
|
|
type: 'success',
|
|
|
message: res.message
|
|
|
});
|
|
|
+ // 刷新列表
|
|
|
+ this.get_table_data('pages');
|
|
|
} else {
|
|
|
this.$message.warning(res.message)
|
|
|
}
|
|
|
@@ -194,7 +271,7 @@
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
- message: '已取消' + txt
|
|
|
+ message: '已取消退房'
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
@@ -443,7 +520,6 @@
|
|
|
|
|
|
.txt-cell-red {
|
|
|
color: #F56C6C;
|
|
|
- font-size: 16px;
|
|
|
}
|
|
|
|
|
|
.pagination-table {
|