|
@@ -2,6 +2,7 @@
|
|
|
import { reactive, onMounted, ref, nextTick } from "vue";
|
|
import { reactive, onMounted, ref, nextTick } from "vue";
|
|
|
import { http } from "@/utils/http";
|
|
import { http } from "@/utils/http";
|
|
|
import { message } from "@/utils/message";
|
|
import { message } from "@/utils/message";
|
|
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
import { useRenderIcon } from "@/components/ReIcon/src/hooks";
|
|
|
import { ExtDLabel, ExtDSelect } from "@/components/ExtForm";
|
|
import { ExtDLabel, ExtDSelect } from "@/components/ExtForm";
|
|
|
import { formatDict } from "@/utils/dict";
|
|
import { formatDict } from "@/utils/dict";
|
|
@@ -108,6 +109,23 @@ const handleView = (row: any) => {
|
|
|
dialogRef.value?.open(row);
|
|
dialogRef.value?.open(row);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const handleForceSettle = (row: any) => {
|
|
|
|
|
+ ElMessageBox.confirm(
|
|
|
|
|
+ `确定要对订单「${row.orderId}」进行强制结算吗?此操作将强制结束该订单并释放设备。`,
|
|
|
|
|
+ "提示",
|
|
|
|
|
+ {
|
|
|
|
|
+ confirmButtonText: "确定结算",
|
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
|
+ type: "warning"
|
|
|
|
|
+ }
|
|
|
|
|
+ ).then(() => {
|
|
|
|
|
+ http.request("post", `/washOrder/forceSettle/${row.orderId}`).then(() => {
|
|
|
|
|
+ ElMessage.success("强制结算成功");
|
|
|
|
|
+ loadData(true);
|
|
|
|
|
+ });
|
|
|
|
|
+ }).catch(() => {});
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const formatMoney = (value: number) => {
|
|
const formatMoney = (value: number) => {
|
|
|
if (value === null || value === undefined) return "0.00";
|
|
if (value === null || value === undefined) return "0.00";
|
|
|
return (value / 100).toFixed(2);
|
|
return (value / 100).toFixed(2);
|
|
@@ -258,11 +276,20 @@ const processDetailData = (detail: any[]) => {
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作" width="100" fixed="right">
|
|
|
|
|
|
|
+ <el-table-column label="操作" width="160" fixed="right">
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
<el-button type="primary" link size="small" @click="handleView(row)">
|
|
<el-button type="primary" link size="small" @click="handleView(row)">
|
|
|
详情
|
|
详情
|
|
|
</el-button>
|
|
</el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="row.orderStatus === 0"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ link
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="handleForceSettle(row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ 强制结算
|
|
|
|
|
+ </el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|