From ed8fa0f5b4b4ff3e1b627e4cca7b33c94acdd7a0 Mon Sep 17 00:00:00 2001
From: FLL <2162874245@qq.com>
Date: Thu, 7 Aug 2025 16:49:46 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=A3=80=E8=B7=AF=E7=BA=BF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shiftSetting/shift-modal.vue | 1 -
.../customerService/centerConsole/index.vue | 9 +++-
.../inspectionRoute/index.vue | 2 +-
.../inspectionRoute/inspectionRoute-modal.vue | 32 ++++++++++-----
.../inspectionRoute/point-modal.vue | 41 ++++++++++++++-----
5 files changed, 60 insertions(+), 25 deletions(-)
diff --git a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue
index dc2ff70d..838d5b3e 100644
--- a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue
+++ b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue
@@ -63,7 +63,6 @@ const [BasicModal, modalApi] = useVbenModal({
];
}
record.status = record.status?.toString();
- console.log(record);
await formApi.setValues(record);
}
await markInitialized();
diff --git a/apps/web-antd/src/views/property/customerService/centerConsole/index.vue b/apps/web-antd/src/views/property/customerService/centerConsole/index.vue
index 95c4f82f..13a5bd7c 100644
--- a/apps/web-antd/src/views/property/customerService/centerConsole/index.vue
+++ b/apps/web-antd/src/views/property/customerService/centerConsole/index.vue
@@ -115,7 +115,6 @@ async function fetchOrderTyper() {
const totalQuantity = board.value.satisfactionChartList.reduce((sum, item) => {
return sum + Number(item.quantity || 0);
}, 0);
- console.log(seriesData.value)
renderOrderTyper({
title: {text: '工单类型分类占比',left: '18px',top: '18px'},
tooltip: {
@@ -127,7 +126,13 @@ async function fetchOrderTyper() {
orient: 'vertical',
icon: 'circle',
itemWidth: 8,
- itemHeight: 8
+ itemHeight: 8,
+ formatter: (name) => {
+ const dataItem = seriesData.value.find(item => item.name === name);
+ const value = dataItem?.value || 0;
+ const percentage = totalQuantity ? ((value / totalQuantity) * 100).toFixed(1) : 0;
+ return `${name} ${percentage}% ${value}个`;
+ },
},
series: [
{
diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue
index a5a30d0e..1bc29de5 100644
--- a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue
+++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/index.vue
@@ -154,6 +154,6 @@ const handleUpdate = (dataSet) => {
-
+
diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue
index 18f22086..284f9a52 100644
--- a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue
+++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/inspectionRoute-modal.vue
@@ -7,7 +7,6 @@ import { useVbenForm } from '#/adapter/form';
import {
inspectionRouteAdd,
inspectionRouteInfo,
- inspectionRouteList,
inspectionRouteUpdate
} from '#/api/property/inspectionManagement/inspectionRoute';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
@@ -62,11 +61,14 @@ const [BasicModal, modalApi] = useVbenModal({
if (isUpdate.value && id) {
const record = await inspectionRouteInfo(id);
pointList.value = (record.inspectionRoutePointVoList || []).map(item => ({
+ id: item.id,
pointId: item.pointId ?? '',
pointName: item.pointName ?? '',
+ startTime: item.startTime ?? '',
+ endTime: item.endTime ?? '',
+ sort: item.sort ?? '',
}));
await tableApi.reload();
- console.log(pointList.value,111)
await formApi.setValues(record);
}
await markInitialized();
@@ -83,10 +85,10 @@ async function handleConfirm() {
}
let data = {
...cloneDeep(await formApi.getValues()),
- inspectionRoutePointBoList:[pointData.value]
+ inspectionRoutePointBoList:[...pointList.value]
}
- console.log(data,333)
await (isUpdate.value ? inspectionRouteUpdate(data) : inspectionRouteAdd(data));
+ pointList.value = []
resetInitialized();
emit('reload');
modalApi.close();
@@ -99,9 +101,11 @@ async function handleConfirm() {
async function handleClosed() {
await formApi.resetForm();
+ pointList.value = []
resetInitialized();
}
+const pointItem = ref([])
async function queryWorkOrdersType() {
let params = {
pageSize: 1000,
@@ -112,6 +116,10 @@ async function queryWorkOrdersType() {
label: item.pointName,
value: item.id,
}));
+ pointItem.value = res.rows.map((item) => ({
+ pointId: item.id,
+ pointName: item.pointName,
+ }));
tableApi.formApi.updateSchema([{
componentProps: () => ({
options: options,
@@ -166,7 +174,6 @@ const gridOptions: VxeGridProps = {
};
const [BasicTable, tableApi] = useVbenVxeGrid({
- formOptions,
gridOptions,
});
@@ -180,15 +187,20 @@ function handleAdd() {
}
async function handleEdit(row: Required) {
- pointModalApi.setData({ id: row.id });
+ pointModalApi.setData({ row });
pointModalApi.open();
}
-const pointData = ref({})
const handlePoint = (data) => {
data.startTime = dayjs(data.startTime).format('YYYY-MM-DD HH:mm:ss')
data.endTime = dayjs(data.endTime).format('YYYY-MM-DD HH:mm:ss')
- pointData.value = data;
+ data.pointName = pointItem.value.find(item => item.pointId === data.pointId)?.pointName;
+ const existingIndex = pointList.value.findIndex(item => item.pointId === data.pointId);
+ if (existingIndex !== -1) {
+ pointList.value[existingIndex] = data;
+ } else {
+ pointList.value.push(data);
+ }
};
@@ -196,7 +208,7 @@ const handlePoint = (data) => {
-
+
{
-
+
diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue
index c21b83c9..34623aed 100644
--- a/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue
+++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionRoute/point-modal.vue
@@ -2,7 +2,7 @@
import { useVbenModal } from '@vben/common-ui';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
-import { inspectionRouteInfo } from '#/api/property/inspectionManagement/inspectionRoute';
+import dayjs from 'dayjs';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import {
inspectionPointList,
@@ -34,6 +34,13 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
},
);
+const props = defineProps({
+ pointList: {
+ type: Array,
+ default: () => [],
+ },
+});
+
const [BasicModal, modalApi] = useVbenModal({
class: 'w-[550px]',
fullscreenButton: false,
@@ -45,13 +52,14 @@ const [BasicModal, modalApi] = useVbenModal({
return null;
}
modalApi.modalLoading(true);
+ const { row } = modalApi.getData() as { row?: number | string };
+ isUpdate.value = !!row;
await queryWorkOrdersType()
- const { id } = modalApi.getData() as { id?: number | string };
- isUpdate.value = !!id;
-
- if (isUpdate.value && id) {
- const record = await inspectionRouteInfo(id);
- await formApi.setValues(record);
+ if (isUpdate.value && row ){
+ row.startTime = dayjs(row.startTime)
+ row.endTime = dayjs(row.endTime)
+ console.log(row,456)
+ await formApi.setValues(row);
}
await markInitialized();
@@ -89,15 +97,26 @@ async function queryWorkOrdersType() {
pageNum: 1
}
const res = await inspectionPointList(params)
- const options = res.rows.map((item) => ({
- label: item.pointName,
- value: item.id,
- }));
+ let options = []
+ if(isUpdate.value){
+ options = res.rows.map((item) => ({
+ label: item.pointName,
+ value: item.id,
+ }));
+ }else{
+ const existingIds = props.pointList.map(item => item.pointId);
+ const filteredRows = res.rows.filter(item => !existingIds.includes(item.id));
+ options = filteredRows.map((item) => ({
+ label: item.pointName,
+ value: item.id,
+ }));
+ }
formApi.updateSchema([{
componentProps: () => ({
options: options,
showSearch: true,
filterOption: filterOption,
+ disabled: isUpdate.value,
}),
fieldName: 'pointId',
}])