style(@vben/web-antd): lint 自动格式化修正工单模块
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -156,7 +156,6 @@ export namespace OpsOrderCenterApi {
|
||||
orderId: number; // 工单ID
|
||||
userId: number; // 操作人ID
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ==================== 工单查询接口 ====================
|
||||
|
||||
@@ -52,10 +52,7 @@ export namespace OpsSecurityOrderApi {
|
||||
export function manualCreateSecurityOrder(
|
||||
data: OpsSecurityOrderApi.ManualCreateReq,
|
||||
) {
|
||||
return requestClient.post<number>(
|
||||
'/ops/security/order/manual-create',
|
||||
data,
|
||||
);
|
||||
return requestClient.post<number>('/ops/security/order/manual-create', data);
|
||||
}
|
||||
|
||||
/** 手动派单(安保) */
|
||||
|
||||
@@ -40,10 +40,10 @@ import {
|
||||
} from '#/api/ops/cleaning';
|
||||
import { getOrderDetail } from '#/api/ops/order-center';
|
||||
|
||||
import SecurityDetailExt from '../../security/work-order/components/security-detail-ext.vue';
|
||||
import CleaningActions from '../components/cleaning-actions.vue';
|
||||
import CleaningDetailExt from '../components/cleaning-detail-ext.vue';
|
||||
import CleaningWorkProgress from '../components/cleaning-work-progress.vue';
|
||||
import SecurityDetailExt from '../../security/work-order/components/security-detail-ext.vue';
|
||||
import {
|
||||
ORDER_TYPE_COLOR_MAP,
|
||||
ORDER_TYPE_TEXT_MAP,
|
||||
|
||||
@@ -6,8 +6,8 @@ import { IconifyIcon } from '@vben/icons';
|
||||
|
||||
import { Alert, Input, message } from 'ant-design-vue';
|
||||
|
||||
import { manualCancelSecurityOrder } from '#/api/ops/security';
|
||||
import { manualCancelOrder } from '#/api/ops/cleaning';
|
||||
import { manualCancelSecurityOrder } from '#/api/ops/security';
|
||||
|
||||
defineOptions({ name: 'CancelOrderForm' });
|
||||
|
||||
@@ -62,17 +62,15 @@ async function handleSubmit() {
|
||||
loading.value = true;
|
||||
modalApi.setState({ confirmLoading: true });
|
||||
try {
|
||||
if (modalData.value.orderType === 'SECURITY') {
|
||||
await manualCancelSecurityOrder({
|
||||
orderId: modalData.value.orderId,
|
||||
reason: val,
|
||||
});
|
||||
} else {
|
||||
await manualCancelOrder({
|
||||
orderId: modalData.value.orderId,
|
||||
reason: val,
|
||||
});
|
||||
}
|
||||
await (modalData.value.orderType === 'SECURITY'
|
||||
? manualCancelSecurityOrder({
|
||||
orderId: modalData.value.orderId,
|
||||
reason: val,
|
||||
})
|
||||
: manualCancelOrder({
|
||||
orderId: modalData.value.orderId,
|
||||
reason: val,
|
||||
}));
|
||||
message.success('工单已取消');
|
||||
modalApi.close();
|
||||
emit('success');
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import type { OpsOrderCenterApi } from '#/api/ops/order-center';
|
||||
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { DICT_TYPE } from '@vben/constants';
|
||||
@@ -20,7 +22,7 @@ import {
|
||||
} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import { type OpsOrderCenterApi, getOrderPage } from '#/api/ops/order-center';
|
||||
import { getOrderPage } from '#/api/ops/order-center';
|
||||
|
||||
import {
|
||||
ORDER_TYPE_COLOR_MAP,
|
||||
@@ -294,8 +296,10 @@ defineExpose({
|
||||
'order-card--terminal': isTerminal(item.status),
|
||||
}"
|
||||
:style="{
|
||||
'--type-color': ORDER_TYPE_COLOR_MAP[item.orderType]?.border || '#d9d9d9',
|
||||
'--type-color-bg': ORDER_TYPE_COLOR_MAP[item.orderType]?.bg || 'rgb(0 0 0 / 3%)',
|
||||
'--type-color':
|
||||
ORDER_TYPE_COLOR_MAP[item.orderType]?.border || '#d9d9d9',
|
||||
'--type-color-bg':
|
||||
ORDER_TYPE_COLOR_MAP[item.orderType]?.bg || 'rgb(0 0 0 / 3%)',
|
||||
}"
|
||||
@click="emit('detail', item.id)"
|
||||
>
|
||||
@@ -305,8 +309,7 @@ defineExpose({
|
||||
<div
|
||||
class="type-badge"
|
||||
:style="{
|
||||
backgroundColor:
|
||||
ORDER_TYPE_COLOR_MAP[item.orderType]?.bg,
|
||||
backgroundColor: ORDER_TYPE_COLOR_MAP[item.orderType]?.bg,
|
||||
color: ORDER_TYPE_COLOR_MAP[item.orderType]?.text,
|
||||
}"
|
||||
>
|
||||
@@ -327,9 +330,7 @@ defineExpose({
|
||||
}"
|
||||
>
|
||||
<IconifyIcon
|
||||
:icon="
|
||||
STATUS_ICON_MAP[item.status] || 'solar:circle-bold'
|
||||
"
|
||||
:icon="STATUS_ICON_MAP[item.status] || 'solar:circle-bold'"
|
||||
class="status-icon"
|
||||
/>
|
||||
<span class="status-text">{{
|
||||
|
||||
@@ -15,6 +15,7 @@ import { useVbenForm, z } from '#/adapter/form';
|
||||
import { getAreaTree } from '#/api/ops/area';
|
||||
import { manualCreateOrder } from '#/api/ops/cleaning';
|
||||
import { manualCreateSecurityOrder } from '#/api/ops/security';
|
||||
|
||||
import { CLEANING_TYPE_OPTIONS } from '../data';
|
||||
|
||||
defineOptions({ name: 'CreateOrderForm' });
|
||||
@@ -62,7 +63,10 @@ const [Form, formApi] = useVbenForm({
|
||||
placeholder: '请输入工单标题',
|
||||
maxLength: 100,
|
||||
},
|
||||
rules: z.string().min(2, '标题至少2个字符').max(100, '标题不能超过100字符'),
|
||||
rules: z
|
||||
.string()
|
||||
.min(2, '标题至少2个字符')
|
||||
.max(100, '标题不能超过100字符'),
|
||||
},
|
||||
{
|
||||
fieldName: 'description',
|
||||
@@ -241,25 +245,23 @@ async function handleSubmit() {
|
||||
loading.value = true;
|
||||
modalApi.setState({ confirmLoading: true });
|
||||
try {
|
||||
if (orderType.value === 'CLEAN') {
|
||||
await manualCreateOrder({
|
||||
title: values.title,
|
||||
description: values.description || undefined,
|
||||
priority: values.priority ?? 2,
|
||||
areaId: selectedAreaId.value,
|
||||
cleaningType: values.cleaningType || undefined,
|
||||
expectedDuration: values.expectedDuration || undefined,
|
||||
});
|
||||
} else {
|
||||
await manualCreateSecurityOrder({
|
||||
title: values.title,
|
||||
description: values.description || undefined,
|
||||
priority: values.priority ?? 2,
|
||||
areaId: selectedAreaId.value,
|
||||
imageUrl: values.imageUrl || undefined,
|
||||
sourceType: 'MANUAL',
|
||||
});
|
||||
}
|
||||
await (orderType.value === 'CLEAN'
|
||||
? manualCreateOrder({
|
||||
title: values.title,
|
||||
description: values.description || undefined,
|
||||
priority: values.priority ?? 2,
|
||||
areaId: selectedAreaId.value,
|
||||
cleaningType: values.cleaningType || undefined,
|
||||
expectedDuration: values.expectedDuration || undefined,
|
||||
})
|
||||
: manualCreateSecurityOrder({
|
||||
title: values.title,
|
||||
description: values.description || undefined,
|
||||
priority: values.priority ?? 2,
|
||||
areaId: selectedAreaId.value,
|
||||
imageUrl: values.imageUrl || undefined,
|
||||
sourceType: 'MANUAL',
|
||||
}));
|
||||
message.success('工单创建成功');
|
||||
modalApi.close();
|
||||
emit('success');
|
||||
@@ -280,7 +282,12 @@ watch(currentStep, (step) => {
|
||||
<template>
|
||||
<Modal title="创建工单" class="w-[580px]">
|
||||
<!-- 步骤条 -->
|
||||
<Steps :current="currentStep" :items="stepItems" size="small" class="co-steps" />
|
||||
<Steps
|
||||
:current="currentStep"
|
||||
:items="stepItems"
|
||||
size="small"
|
||||
class="co-steps"
|
||||
/>
|
||||
|
||||
<!-- Step 1: 选择工单类型 -->
|
||||
<div v-show="currentStep === 0" class="co-step-content">
|
||||
@@ -290,7 +297,7 @@ watch(currentStep, (step) => {
|
||||
:class="{ 'co-type-card--active': orderType === 'CLEAN' }"
|
||||
@click="selectType('CLEAN')"
|
||||
>
|
||||
<div class="co-type-icon" style="background: #e5faf2; color: #047857">
|
||||
<div class="co-type-icon" style="color: #047857; background: #e5faf2">
|
||||
<IconifyIcon icon="solar:bath-bold-duotone" class="size-6" />
|
||||
</div>
|
||||
<div class="co-type-info">
|
||||
@@ -308,7 +315,7 @@ watch(currentStep, (step) => {
|
||||
:class="{ 'co-type-card--active': orderType === 'SECURITY' }"
|
||||
@click="selectType('SECURITY')"
|
||||
>
|
||||
<div class="co-type-icon" style="background: #eef0ff; color: #3730a3">
|
||||
<div class="co-type-icon" style="color: #3730a3; background: #eef0ff">
|
||||
<IconifyIcon icon="solar:shield-bold-duotone" class="size-6" />
|
||||
</div>
|
||||
<div class="co-type-info">
|
||||
@@ -331,11 +338,15 @@ watch(currentStep, (step) => {
|
||||
<TreeSelect
|
||||
v-model:value="selectedAreaId"
|
||||
:tree-data="areaTreeData"
|
||||
:field-names="{ label: 'areaName', value: 'id', children: 'children' }"
|
||||
:field-names="{
|
||||
label: 'areaName',
|
||||
value: 'id',
|
||||
children: 'children',
|
||||
}"
|
||||
:loading="areaTreeLoading"
|
||||
tree-default-expand-all
|
||||
show-search
|
||||
:tree-node-filter-prop="'areaName'"
|
||||
tree-node-filter-prop="areaName"
|
||||
placeholder="搜索并选择区域"
|
||||
allow-clear
|
||||
style="width: 100%"
|
||||
@@ -343,7 +354,10 @@ watch(currentStep, (step) => {
|
||||
@change="handleAreaChange"
|
||||
/>
|
||||
<div v-if="selectedAreaId" class="co-area-selected">
|
||||
<IconifyIcon icon="solar:map-point-bold-duotone" class="co-area-icon" />
|
||||
<IconifyIcon
|
||||
icon="solar:map-point-bold-duotone"
|
||||
class="co-area-icon"
|
||||
/>
|
||||
<span>已选择: {{ selectedAreaPath }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -353,14 +367,21 @@ watch(currentStep, (step) => {
|
||||
<div v-show="currentStep === 2" class="co-step-content">
|
||||
<!-- 已选信息概要 -->
|
||||
<div class="co-summary">
|
||||
<span class="co-summary-tag" :style="orderType === 'CLEAN'
|
||||
? 'background:#e5faf2;color:#047857'
|
||||
: 'background:#eef0ff;color:#3730a3'
|
||||
">
|
||||
<span
|
||||
class="co-summary-tag"
|
||||
:style="
|
||||
orderType === 'CLEAN'
|
||||
? 'background:#e5faf2;color:#047857'
|
||||
: 'background:#eef0ff;color:#3730a3'
|
||||
"
|
||||
>
|
||||
{{ orderType === 'CLEAN' ? '保洁' : '安保' }}
|
||||
</span>
|
||||
<span class="co-summary-area">
|
||||
<IconifyIcon icon="solar:map-point-bold-duotone" class="co-summary-icon" />
|
||||
<IconifyIcon
|
||||
icon="solar:map-point-bold-duotone"
|
||||
class="co-summary-icon"
|
||||
/>
|
||||
{{ selectedAreaPath || '未选择区域' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user