|
|
@@ -45,7 +45,7 @@
|
|
|
<el-button type="primary" plain>关闭订单</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="primary" plain>删除订单</el-button>
|
|
|
+ <el-button type="primary" @click="handleDelete()" plain>删除订单</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button type="primary" plain>导出订单</el-button>
|
|
|
@@ -131,12 +131,7 @@
|
|
|
>查看订单信息</el-button
|
|
|
>
|
|
|
<el-button link type="primary" v-if="scope.row.orderStatus === '4' || scope.row.orderStatus === '5'">查看物流</el-button>
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- v-if="scope.row.orderStatus === '0' || scope.row.orderStatus === '3' || scope.row.orderStatus === '4' || scope.row.orderStatus === '5'"
|
|
|
- >取消订单</el-button
|
|
|
- >
|
|
|
+ <el-button link type="primary" @click="handleCancel(scope.row)" v-if="scope.row.orderStatus != '7'">取消订单</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -157,6 +152,7 @@ import {
|
|
|
addOrderMain,
|
|
|
updateOrderMain,
|
|
|
queryOrderStatusStats,
|
|
|
+ changeStatus,
|
|
|
changeCheckStatus
|
|
|
} from '@/api/order/orderMain';
|
|
|
import { OrderMainVO, OrderMainQuery, OrderMainForm } from '@/api/order/orderMain/types';
|
|
|
@@ -205,12 +201,12 @@ const orderStatusStats = ref({
|
|
|
const initFormData: OrderMainForm = {
|
|
|
id: undefined,
|
|
|
orderNo: undefined,
|
|
|
- isSplitChild: undefined,
|
|
|
shipmentNo: undefined,
|
|
|
subOrderNo: undefined,
|
|
|
companyId: undefined,
|
|
|
customerId: undefined,
|
|
|
customerCode: undefined,
|
|
|
+ isSplitChild: undefined,
|
|
|
userId: undefined,
|
|
|
shippingAddressId: undefined,
|
|
|
purchaseReason: undefined,
|
|
|
@@ -376,7 +372,7 @@ const handleSelectionChange = (selection: OrderMainVO[]) => {
|
|
|
|
|
|
const handleReview = (row?: OrderMainVO) => {
|
|
|
router.push({
|
|
|
- path: '/order-manage/order-sendDetail',
|
|
|
+ path: '/order-center/order-sendDetail',
|
|
|
query: { id: row.id }
|
|
|
});
|
|
|
};
|
|
|
@@ -466,6 +462,25 @@ const handleCheck = async (row?: OrderMainVO) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+/** 审核按钮操作 */
|
|
|
+const handleCancel = async (row?: OrderMainVO) => {
|
|
|
+ const oldValue = row.checkStatus; // 保存旧值
|
|
|
+
|
|
|
+ // 弹出审核选择对话框
|
|
|
+ try {
|
|
|
+ // 调用接口,传入用户选择的值
|
|
|
+ await changeStatus(row.id, '7');
|
|
|
+ getList();
|
|
|
+ proxy?.$modal.msgSuccess('操作成功');
|
|
|
+ } catch (error) {
|
|
|
+ // 用户取消或操作失败
|
|
|
+ if (error !== 'cancel' && error !== 'close') {
|
|
|
+ row.checkStatus = oldValue; // 失败回滚
|
|
|
+ proxy?.$modal.msgError('操作失败,请重试');
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
/** 发货按钮操作 */
|
|
|
const handleDeliver = (row?: OrderMainVO) => {
|
|
|
if (!row?.id) {
|