|
|
@@ -24,6 +24,7 @@
|
|
|
<el-option label="已确认" value="Confirmed"></el-option>
|
|
|
<el-option label="处理中" value="Processing"></el-option>
|
|
|
<el-option label="已完成" value="Completed"></el-option>
|
|
|
+ <el-option label="取消中" value="Cancelling"></el-option>
|
|
|
<el-option label="已取消" value="Cancelled"></el-option>
|
|
|
<el-option label="已驳回" value="Rejected"></el-option>
|
|
|
</el-select>
|
|
|
@@ -116,15 +117,21 @@
|
|
|
|
|
|
<el-table-column fixed="right" label="操作" width="320">
|
|
|
<template #default="scope">
|
|
|
- <!-- <el-button type="primary" link size="small" @click="edit(scope.row)">编辑</el-button> -->
|
|
|
- <!-- <el-button type="success" link size="small" @click="audit(scope.row)">审核</el-button> -->
|
|
|
- <el-button type="info" link size="small" @click="attachment(scope.row)">附件</el-button>
|
|
|
- <el-button type="warning" v-if="userAccountId === 'testuser' && orderCanPay(scope.row)" link size="small"
|
|
|
- @click="payment(scope.row)">收款</el-button>
|
|
|
- <el-button type="info" link size="small" @click="editSchedule(scope.row)">行程</el-button>
|
|
|
- <el-button type="primary" link size="small" @click="editTourists(scope.row)">游客</el-button>
|
|
|
- <el-button v-if="scope.row.status === 'Submitted'" type="danger" link size="small"
|
|
|
- @click="del(scope.row)">删除</el-button>
|
|
|
+ <div>
|
|
|
+ <!-- <el-button type="primary" link size="small" @click="edit(scope.row)">编辑</el-button> -->
|
|
|
+ <!-- <el-button type="success" link size="small" @click="audit(scope.row)">审核</el-button> -->
|
|
|
+ <el-button type="info" link size="small" @click="attachment(scope.row)">附件</el-button>
|
|
|
+ <el-button type="info" link size="small" @click="editSchedule(scope.row)">行程</el-button>
|
|
|
+ <el-button type="primary" link size="small" @click="editTourists(scope.row)">游客</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <el-button v-if="userAccountId === 'testuser' && orderCanPay(scope.row)" type="warning" link size="small"
|
|
|
+ @click="payment(scope.row)">收款</el-button>
|
|
|
+ <el-button v-if="!['Completed', 'Cancelled'].includes(scope.row.status)" type="primary" link size="small"
|
|
|
+ @click="cancel(scope.row)">取消</el-button>
|
|
|
+ <el-button v-if="scope.row.status === 'Submitted'" type="danger" link size="small"
|
|
|
+ @click="del(scope.row)">删除</el-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -414,6 +421,7 @@
|
|
|
<el-option label="已确认" value="Confirmed"></el-option>
|
|
|
<el-option label="处理中" value="Processing"></el-option>
|
|
|
<el-option label="已完成" value="Completed"></el-option>
|
|
|
+ <el-option label="取消中" value="Cancelling"></el-option>
|
|
|
<el-option label="已取消" value="Cancelled"></el-option>
|
|
|
<el-option label="已驳回" value="Rejected"></el-option>
|
|
|
</el-select>
|
|
|
@@ -851,10 +859,17 @@
|
|
|
<el-form-item label="收款方式" prop="method">
|
|
|
<el-radio-group v-model="paymentForm.method">
|
|
|
<el-radio-button label="Online">在线支付</el-radio-button>
|
|
|
- <el-radio-button label="Balance">余额扣款</el-radio-button>
|
|
|
- <el-radio-button label="Offline">线下支付</el-radio-button>
|
|
|
+ <!-- <el-radio-button label="Balance">余额扣款</el-radio-button>
|
|
|
+ <el-radio-button label="Offline">线下支付</el-radio-button> -->
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="支付方式" prop="paymentMethod" v-if="paymentForm.method === 'Online'">
|
|
|
+ <el-radio-group v-model="paymentForm.paymentMethod">
|
|
|
+ <el-radio-button label="WeChat">微信支付</el-radio-button>
|
|
|
+ <!-- <el-radio-button label="Alipay">支付宝支付</el-radio-button> -->
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
|
|
|
<el-form-item label="收款金额" prop="amount">
|
|
|
<el-input-number v-model.number="paymentForm.amount" disabled :min="0" :precision="2" style="width:200px" />
|
|
|
@@ -907,6 +922,7 @@ import store from "@/store";
|
|
|
import {
|
|
|
getOrders,
|
|
|
getOrderNo,
|
|
|
+ cancelOrder,
|
|
|
delOrder,
|
|
|
createOrder,
|
|
|
updateOrder,
|
|
|
@@ -1121,8 +1137,10 @@ export default {
|
|
|
fileList: [],
|
|
|
paymentDialogVisible: false,
|
|
|
paymentForm: {
|
|
|
+ id: '',
|
|
|
amount: null,
|
|
|
method: 'Online',
|
|
|
+ paymentMethod: 'WeChat',
|
|
|
orderNo: '',
|
|
|
},
|
|
|
onlinePaymentDialogVisible: false,
|
|
|
@@ -1302,14 +1320,18 @@ export default {
|
|
|
async payment(row) {
|
|
|
const res = await getPayParams(row.id);
|
|
|
console.log('---pay params---', res);
|
|
|
+ this.paymentForm.id = row.id;
|
|
|
this.paymentForm.orderNo = row.orderNo;
|
|
|
this.paymentForm.amount = row.totalAmount;
|
|
|
+ this.paymentForm.paymentMethod = 'WeChat';
|
|
|
this.paymentDialogVisible = true;
|
|
|
},
|
|
|
cancelPayment() {
|
|
|
this.paymentForm = {
|
|
|
+ id: '',
|
|
|
amount: null,
|
|
|
method: 'Online',
|
|
|
+ paymentMethod: 'WeChat',
|
|
|
orderNo: '',
|
|
|
};
|
|
|
},
|
|
|
@@ -1354,11 +1376,41 @@ export default {
|
|
|
this.onlinePaymentDialogVisible = false;
|
|
|
document.getElementById('payment-qr-code').innerHTML = '';
|
|
|
},
|
|
|
- submitOnlinePayment() {
|
|
|
+ async submitOnlinePayment() {
|
|
|
+ const { id } = this.paymentForm;
|
|
|
+ const res = await getOrderDetailById(id);
|
|
|
+ if (res.data?.order?.status !== 'Paid') {
|
|
|
+ this.$message.error('支付未完成,请确认已支付');
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.$message.success('支付成功');
|
|
|
this.onlinePaymentDialogVisible = false;
|
|
|
+ this.paymentDialogVisible = false;
|
|
|
this.getOrderList();
|
|
|
},
|
|
|
+ async cancel(row) {
|
|
|
+ const res = await getOrderDetailById(row.id);
|
|
|
+ const details = res.data?.details || [];
|
|
|
+ let cancelRemark = '';
|
|
|
+ this.$prompt("请输入取消原因", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ inputPattern: /^.{1,100}$/,
|
|
|
+ inputErrorMessage: "请输入1-100个字符",
|
|
|
+ }).then(({ value }) => {
|
|
|
+ cancelRemark = value;
|
|
|
+ cancelOrder(row.id, map(details, item => item.id), cancelRemark).then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "订单已取消",
|
|
|
+ });
|
|
|
+ this.getOrderList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
del(row) {
|
|
|
this.$confirm("此操作将删除选择数据, 是否继续?", "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", })
|
|
|
.then(() => {
|
|
|
@@ -1385,6 +1437,7 @@ export default {
|
|
|
'Processing': 'warning',
|
|
|
'Completed': 'success',
|
|
|
'Cancelled': 'danger',
|
|
|
+ 'Cancelling': 'warning',
|
|
|
'Rejected': 'danger'
|
|
|
}
|
|
|
return types[status] || 'info'
|
|
|
@@ -1560,6 +1613,7 @@ export default {
|
|
|
'Processing': '处理中',
|
|
|
'Completed': '已完成',
|
|
|
'Cancelled': '已取消',
|
|
|
+ 'Cancelling': '取消中',
|
|
|
'Rejected': '已驳回'
|
|
|
}
|
|
|
return texts[status] || status
|