From 8e361c6b59b096a654289615b4a1c1ba772582c2 Mon Sep 17 00:00:00 2001 From: dev_ljl <2590379346@qq.com> Date: Tue, 15 Jul 2025 15:39:58 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=B7=A1=E6=A3=80=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inspectionPlan/model.d.ts | 23 +-- .../inspectionDetails/data.ts | 160 ++++++++++++++++++ .../inspectionDetails/index.vue | 113 +++++++++++++ .../inspectionDetails-modal.vue | 101 +++++++++++ .../inspectionPlan/inspectionPlan-modal.vue | 55 +++--- 5 files changed, 414 insertions(+), 38 deletions(-) create mode 100644 apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/data.ts create mode 100644 apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/index.vue create mode 100644 apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/inspectionDetails-modal.vue diff --git a/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts b/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts index 983e43fe..56008843 100644 --- a/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts +++ b/apps/web-antd/src/api/property/inspectionManagement/inspectionPlan/model.d.ts @@ -59,7 +59,7 @@ export interface InspectionPlanVO { /** * 选择员工 */ - userId: string | number; + userId: string; /** * 备注 @@ -74,21 +74,22 @@ export interface InspectionPlanVO { /** * 巡检月 */ - inspectionMonth?:string; + inspectionMonth?: string; /** * 巡检日 */ - inspectionDay?:string; + inspectionDay?: string; /** * 巡检周 */ - inspectionWorkday?:string; + inspectionWorkday?: string; /** * 状态 */ - state?:string + state?: string + inspectionPlanStaffVoList?: any[] } export interface InspectionPlanForm extends BaseEntity { @@ -159,15 +160,15 @@ export interface InspectionPlanForm extends BaseEntity { /** * 巡检月 */ - inspectionMonth?:string; + inspectionMonth?: string; /** * 巡检日 */ - inspectionDay?:string; + inspectionDay?: string; /** * 巡检周 */ - inspectionWorkday?:string; + inspectionWorkday?: string; } @@ -234,13 +235,13 @@ export interface InspectionPlanQuery extends PageQuery { /** * 巡检月 */ - inspectionMonth?:string; + inspectionMonth?: string; /** * 巡检日 */ - inspectionDay?:string; + inspectionDay?: string; /** * 巡检周 */ - inspectionWorkday?:string; + inspectionWorkday?: string; } diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/data.ts b/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/data.ts new file mode 100644 index 00000000..679a5ade --- /dev/null +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/data.ts @@ -0,0 +1,160 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; +import {renderDict} from "#/utils/render"; +import {getDictOptions} from "#/utils/dict"; + +1 + + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'actUserId', + label: '当前巡检人', + }, + { + component: 'Select', + componentProps: { + options:getDictOptions('wy_xjqdfs') + }, + fieldName: 'taskType', + label: '巡检方式', + }, +]; + +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '任务编号', + field: 'id', + width:'auto' + }, + { + title: '巡检计划', + field: 'planName', + minWidth:200 + }, + { + title: '巡检时间范围', + field: 'planInsTime', + width:'auto' + + }, + // { + // title: '实际巡检时间', + // field: 'endDate', + // width:180 + // + // }, + { + title: '签到状态', + field: 'actInsTime', + width:150, + }, + { + title: '巡检人', + field: 'planUserName', + width:'auto' + + }, + { + title: '巡检方式', + field: 'taskType', + width:'auto', + slots: { + default: ({ row }) => { + return renderDict(row.taskType, 'wy_xjqdfs'); + }, + }, + }, + { + title: '巡检状态', + field: 'status', + width:100, + slots: { + default: ({ row }) => { + return renderDict(row.taskType, 'wy_xjqdfs'); + }, + }, + }, + { + title: '巡检照片', + field: 'remark', + width:120 + }, + // { + // field: 'action', + // fixed: 'right', + // slots: { default: 'action' }, + // title: '操作', + // width: 120, + // }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键id', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '巡检计划', + fieldName: 'planName', + component: 'Input', + }, + { + label: '巡检开始日期', + fieldName: 'startDate', + component: 'Input', + }, + { + label: '巡检结束日期', + fieldName: 'endDate', + component: 'Input', + }, + { + label: '实际巡检时间', + fieldName: 'actInsTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + }, + { + label: '当前巡检人', + fieldName: 'actUserId', + component: 'Input', + }, + { + label: '巡检方式', + fieldName: 'taskType', + component: 'Select', + componentProps: { + }, + }, + { + label: '转移描述', + fieldName: 'transferDesc', + component: 'Textarea', + }, + { + label: '巡检状态', + fieldName: 'status', + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + label: '备注', + fieldName: 'remark', + component: 'Input', + }, +]; diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/index.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/index.vue new file mode 100644 index 00000000..28e6325c --- /dev/null +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/index.vue @@ -0,0 +1,113 @@ + + + diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/inspectionDetails-modal.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/inspectionDetails-modal.vue new file mode 100644 index 00000000..b1d11246 --- /dev/null +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionDetails/inspectionDetails-modal.vue @@ -0,0 +1,101 @@ + + + + diff --git a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue index a7218266..bbd5bab6 100644 --- a/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue +++ b/apps/web-antd/src/views/property/inspectionManagement/inspectionPlan/inspectionPlan-modal.vue @@ -68,14 +68,14 @@ const [BasicModal, modalApi] = useVbenModal({ if (isUpdate.value && id) { const record = await inspectionPlanInfo(id); record.planDate = [record.startDate, record.endDate] - if(record.inspectionPlanPeriod=='1'){ - record.inspectionMonth=record.inspectionMonth?.split(',') - record.inspectionDay=record.inspectionDay?.split(',') - }else { - record.inspectionWorkday=record.inspectionWorkday?.split(',') + if (record.inspectionPlanPeriod == '1') { + record.inspectionMonth = record.inspectionMonth?.split(',') + record.inspectionDay = record.inspectionDay?.split(',') + } else { + record.inspectionWorkday = record.inspectionWorkday?.split(',') } - if(record.inspectionPlanStaffVoList&&record.inspectionPlanStaffVoList.length){ - record.userId=record.inspectionPlanStaffVoList.map(item=>item.userId) + if (record.inspectionPlanStaffVoList && record.inspectionPlanStaffVoList.length) { + record.userId = record.inspectionPlanStaffVoList.map(item => item.userId) } await formApi.setValues(record); } @@ -97,28 +97,28 @@ async function handleConfirm() { if (data.planDate && data.planDate.length) { data.startDate = data.planDate[0] data.endDate = data.planDate[1] - data.startTime=data.planDate[0]?.split(' ')[1] - data.endTime=data.planDate[1]?.split(' ')[1] + data.startTime = data.planDate[0]?.split(' ')[1] + data.endTime = data.planDate[1]?.split(' ')[1] } - if(data.inspectionPlanPeriod=='1'){ - data.inspectionMonth=data.inspectionMonth?.join(',') - data.inspectionDay=data.inspectionDay?.join(',') - data.inspectionWorkday=undefined - }else { - data.inspectionWorkday=data.inspectionWorkday?.join(',') - data.inspectionMonth=undefined - data.inspectionDay=undefined + if (data.inspectionPlanPeriod == '1') { + data.inspectionMonth = data.inspectionMonth?.join(',') + data.inspectionDay = data.inspectionDay?.join(',') + data.inspectionWorkday = undefined + } else { + data.inspectionWorkday = data.inspectionWorkday?.join(',') + data.inspectionMonth = undefined + data.inspectionDay = undefined } - if(data.userId){ - data.inspectionPlanStaffBoList=[] - data.userId.forEach(item=> + if (data.userId) { + data.inspectionPlanStaffBoList = [] + data.userId.forEach((item: any) => { data.inspectionPlanStaffBoList.push({ - userId:item, - startTime:data.startDate, - endTime:data.endDate - })) + userId: item, + startTime: data.startDate, + endTime: data.endDate + }) + }) } - // data.userId=data.userId?.join(',') await (isUpdate.value ? inspectionPlanUpdate(data) : inspectionPlanAdd(data)); resetInitialized(); emit('reload'); @@ -143,7 +143,7 @@ async function queryPersonData() { const res = await personList(params); const options = res.rows.map((user) => ({ label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex') - + '-' + user.phone+'-'+user.unitName, + + '-' + user.phone + '-' + user.unitName, value: user.id, })); formApi.updateSchema([{ @@ -200,12 +200,13 @@ const filterOption = (input: string, option: any) => {