Commit 7483ee1a by chenwq1

feat: 工单详情新增状态

1 parent 02241e01
Pipeline #159 for 7483ee1a failed in 0 seconds
...@@ -15,6 +15,7 @@ type AuditStatus = 1 | 2 | 3 | 4; ...@@ -15,6 +15,7 @@ type AuditStatus = 1 | 2 | 3 | 4;
const props = defineProps<{ const props = defineProps<{
auditStatus?: AuditStatus; auditStatus?: AuditStatus;
onlyAudit?: boolean;
status: WorkOrderStatus; status: WorkOrderStatus;
}>(); }>();
...@@ -56,7 +57,8 @@ const auditTag = computed(() => { ...@@ -56,7 +57,8 @@ const auditTag = computed(() => {
<template> <template>
<div class="wo-tags"> <div class="wo-tags">
<van-tag class="wo-tag" <van-tag v-if="!props.onlyAudit"
class="wo-tag"
:style="{ background: checkTag.bg, color: checkTag.color }"> :style="{ background: checkTag.bg, color: checkTag.color }">
{{ checkTag.text }} {{ checkTag.text }}
</van-tag> </van-tag>
......
...@@ -14,6 +14,7 @@ import { useRoute, useRouter } from "vue-router"; ...@@ -14,6 +14,7 @@ import { useRoute, useRouter } from "vue-router";
import { getWorkOrderDetail } from "@/api/modules/work-order"; import { getWorkOrderDetail } from "@/api/modules/work-order";
import PageTitle from "@/components/PageTitle.vue"; import PageTitle from "@/components/PageTitle.vue";
import WorkOrderStatusTags from "@/components/WorkOrderStatusTags.vue";
const title = ref("工单详情"); const title = ref("工单详情");
const route = useRoute(); const route = useRoute();
...@@ -24,6 +25,10 @@ const nodes = ref<NodeVO[]>([]); ...@@ -24,6 +25,10 @@ const nodes = ref<NodeVO[]>([]);
const orderNo = computed(() => detail.value?.woId ?? ""); const orderNo = computed(() => detail.value?.woId ?? "");
const status = computed<WorkOrderStatus>(() => (detail.value?.status ?? 1) as WorkOrderStatus); const status = computed<WorkOrderStatus>(() => (detail.value?.status ?? 1) as WorkOrderStatus);
const auditStatus = computed<1 | 2 | 3 | 4 | undefined>(() => {
const v = (detail.value as null | Record<string, unknown>)?.auditStatus;
return typeof v === "number" ? (v as 1 | 2 | 3 | 4) : undefined;
});
const vehicle = computed<WorkOrderVehicle>(() => (detail.value?.vehicle ?? {}) as WorkOrderVehicle); const vehicle = computed<WorkOrderVehicle>(() => (detail.value?.vehicle ?? {}) as WorkOrderVehicle);
...@@ -116,9 +121,12 @@ onMounted(() => { ...@@ -116,9 +121,12 @@ onMounted(() => {
<van-tag class="head-tag" :style="{ background: pageStatusTag.bg, color: pageStatusTag.color }"> <van-tag class="head-tag" :style="{ background: pageStatusTag.bg, color: pageStatusTag.color }">
{{ pageStatusTag.text }} {{ pageStatusTag.text }}
</van-tag> </van-tag>
工单号 <span class="head-order">{{ orderNo }}</span>
</div> </div>
<div class="head-right"> <div class="head-right">
工单号 <span class="head-order">{{ orderNo }}</span> <WorkOrderStatusTags :audit-status="auditStatus"
only-audit
:status="status" />
</div> </div>
</div> </div>
...@@ -294,7 +302,9 @@ onMounted(() => { ...@@ -294,7 +302,9 @@ onMounted(() => {
.page-head { .page-head {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
gap: 8px;
margin-left: 12px; margin-left: 12px;
background: #f0f2f5; background: #f0f2f5;
} }
...@@ -317,8 +327,13 @@ onMounted(() => { ...@@ -317,8 +327,13 @@ onMounted(() => {
} }
.head-right { .head-right {
display: flex;
gap: 6px;
align-items: center;
flex-wrap: wrap;
font-size: 12px; font-size: 12px;
color: #999; color: #999;
margin-right:12px;
} }
.head-order { .head-order {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!