|
|
@@ -73,6 +73,12 @@
|
|
|
<el-table-column label="退货原因" align="center" prop="returnReason" />
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template #default="scope">
|
|
|
+ <el-button link type="primary" v-if="scope.row.returnStatus == '0'" icon="Edit" @click="handleChangeReturnStatus(scope.row, '1')"
|
|
|
+ >确认退货</el-button
|
|
|
+ >
|
|
|
+ <el-button link type="primary" v-if="scope.row.returnStatus == '0'" icon="Edit" @click="handleChangeReturnStatus(scope.row, '2')"
|
|
|
+ >拒绝退货</el-button
|
|
|
+ >
|
|
|
<el-button link type="primary" icon="Edit" @click="handleReview(scope.row)">查看退货信息</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
@@ -84,7 +90,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup name="OrderReturn" lang="ts">
|
|
|
-import { listOrderReturn, getOrderReturn, delOrderReturn, addOrderReturn, updateOrderReturn } from '@/api/order/orderReturn';
|
|
|
+import { listOrderReturn, getOrderReturn, delOrderReturn, addOrderReturn, updateOrderReturn, changeReturnStatus } from '@/api/order/orderReturn';
|
|
|
import { OrderReturnVO, OrderReturnQuery, OrderReturnForm } from '@/api/order/orderReturn/types';
|
|
|
import { listReturnReason } from '@/api/order/returnReason';
|
|
|
import { ReturnReasonVO } from '@/api/order/returnReason/types';
|
|
|
@@ -280,6 +286,22 @@ const loadReturnReasonList = async () => {
|
|
|
returnReasonList.value = [];
|
|
|
}
|
|
|
};
|
|
|
+const handleChangeReturnStatus = async (row?: OrderReturnVO, returnStatus?: string) => {
|
|
|
+ const _no = row?.returnNo;
|
|
|
+ const _ids = row?.id || ids.value;
|
|
|
+ const oldValue = row.returnStatus; // 保存旧值
|
|
|
+ const text = returnStatus === '1' ? '确认退货' : returnStatus === '2' ? '拒绝退货' : '';
|
|
|
+ await proxy?.$modal.confirm('是否' + text + '当前退货单编号【' + _no + '】吗?').finally(() => (loading.value = false));
|
|
|
+
|
|
|
+ try {
|
|
|
+ await changeReturnStatus(row.id, returnStatus); // 传新值
|
|
|
+ } catch (e) {
|
|
|
+ // 恢复旧值
|
|
|
+ row.returnStatus = oldValue;
|
|
|
+ }
|
|
|
+ proxy?.$modal.msgSuccess('操作成功');
|
|
|
+ await getList();
|
|
|
+};
|
|
|
|
|
|
onMounted(() => {
|
|
|
getList();
|