取消订单设置

This commit is contained in:
bb_pan 2025-02-24 16:32:55 +08:00
parent f67b394ea1
commit ff6fba29a6
2 changed files with 16 additions and 10 deletions

View File

@ -383,17 +383,17 @@ const downloadContract = () => {
// }
}
const confirmFail = async (index: number) => {
const confirmFail = async (item: any) => {
ElMessageBox.confirm('是否确定取消订单?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return failApi({ orderId: cardList.value[index].orderId, orderStatus: 99 })
return failApi({ orderId: item.orderId, orderStatus: 99 })
// return removeDeviceApi([row.maId])
})
.then((res) => {
.then((res: any) => {
if (res.code === 200) {
ElMessage({
type: 'success',
@ -865,10 +865,10 @@ const costSubmit = () => {
</el-button>
<!-- <el-button type="primary" size="small"> 发起减免 </el-button> -->
<el-button
v-if="item.orderStatus == '2'"
v-if="item.orderStatus == '1' || item.orderStatus == '2'"
type="primary"
size="small"
@click="confirmFail(index)"
@click="confirmFail(item)"
>
取消订单
</el-button>

View File

@ -200,17 +200,18 @@ const confirmPass = async (index: number) => {
}
//
const confirmFail = async (index: number) => {
const confirmFail = async (item: any) => {
// console.log(item.orderId, '-->>>')
ElMessageBox.confirm('是否确定取消?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
return failApi({ orderId: cardList.value[index].orderId, orderStatus: 99 })
return failApi({ orderId: item.orderId, orderStatus: 99 })
// return removeDeviceApi([row.maId])
})
.then((res) => {
.then((res: any) => {
if (res.code === 200) {
ElMessage({
type: 'success',
@ -703,6 +704,11 @@ const downloadContract = () => {
}
const wordUrl = ref('')
//
const handleCancel = () => {
}
</script>
<template>
@ -1130,8 +1136,8 @@ const wordUrl = ref('')
<el-button
size="small"
type="primary"
v-if="item.orderStatus == '2'"
@click="confirmFail(index)"
v-if="item.orderStatus == '1'"
@click="confirmFail(item)"
>
取消订单
</el-button>