Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
commit
975e45fea6
@ -1,4 +1,4 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import type {PageQuery, BaseEntity} from '#/api/common';
|
||||
|
||||
export interface InspectionPlanVO {
|
||||
/**
|
||||
@ -66,6 +66,28 @@ export interface InspectionPlanVO {
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 计划时间区间
|
||||
*/
|
||||
planDate?: any[];
|
||||
|
||||
/**
|
||||
* 巡检月
|
||||
*/
|
||||
inspectionMonth?:string;
|
||||
/**
|
||||
* 巡检日
|
||||
*/
|
||||
inspectionDay?:string;
|
||||
/**
|
||||
* 巡检周
|
||||
*/
|
||||
inspectionWorkday?:string;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
state?:string
|
||||
}
|
||||
|
||||
export interface InspectionPlanForm extends BaseEntity {
|
||||
@ -133,6 +155,18 @@ export interface InspectionPlanForm extends BaseEntity {
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
/**
|
||||
* 巡检月
|
||||
*/
|
||||
inspectionMonth?:string;
|
||||
/**
|
||||
* 巡检日
|
||||
*/
|
||||
inspectionDay?:string;
|
||||
/**
|
||||
* 巡检周
|
||||
*/
|
||||
inspectionWorkday?:string;
|
||||
|
||||
}
|
||||
|
||||
@ -193,7 +227,19 @@ export interface InspectionPlanQuery extends PageQuery {
|
||||
userId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
/**
|
||||
* 巡检月
|
||||
*/
|
||||
inspectionMonth?:string;
|
||||
/**
|
||||
* 巡检日
|
||||
*/
|
||||
inspectionDay?:string;
|
||||
/**
|
||||
* 巡检周
|
||||
*/
|
||||
inspectionWorkday?:string;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import type {FormSchemaGetter} from '#/adapter/form';
|
||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {z} from "#/adapter/form";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
@ -32,71 +33,65 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '主键id',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '巡检计划名称',
|
||||
title: '计划名称',
|
||||
field: 'planName',
|
||||
minWidth: 180,
|
||||
},
|
||||
{
|
||||
title: '巡检路线',
|
||||
field: 'inspectionRouteId',
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '巡检周期',
|
||||
field: 'inspectionPlanPeriod',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.inspectionPlanPeriod, 'wy_xjzq');
|
||||
},
|
||||
},
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '任务提前分组',
|
||||
title: '任务提前分钟',
|
||||
field: 'beforeTime',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '开始日期',
|
||||
field: 'startDate',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '结束日期',
|
||||
field: 'endDate',
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
field: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
field: 'endTime',
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '签到方式',
|
||||
field: 'signType',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.signType, 'wy_xjqdfs');
|
||||
},
|
||||
},
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '是否允许补检',
|
||||
field: 'canReexamine',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.canReexamine, 'wy_sf');
|
||||
},
|
||||
},
|
||||
width: 120,
|
||||
},
|
||||
{
|
||||
title: '选择员工',
|
||||
field: 'userId',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
field: 'remark',
|
||||
title: '状态',
|
||||
field: 'state',
|
||||
width: 120,
|
||||
slots:{default: 'state'}
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
@ -118,7 +113,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '巡检计划名称',
|
||||
label: '计划名称',
|
||||
fieldName: 'planName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
@ -126,61 +121,80 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '巡检路线',
|
||||
fieldName: 'inspectionRouteId',
|
||||
component: 'Input',
|
||||
component: 'ApiSelect',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '巡检周期',
|
||||
fieldName: 'inspectionPlanPeriod',
|
||||
component: 'Input',
|
||||
component: 'Select',
|
||||
rules: 'required',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_xjzq'),
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '任务提前分组',
|
||||
label: '任务提前',
|
||||
fieldName: 'beforeTime',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
rules: z.number({
|
||||
required_error: "请输入任务提前完成分钟数",
|
||||
invalid_type_error: "请输入任务提前完成分钟数"
|
||||
}),
|
||||
slots: {default: 'beforeTime'},
|
||||
},
|
||||
{
|
||||
label: '开始日期',
|
||||
fieldName: 'startDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
label: '周',
|
||||
fieldName: 'inspectionWorkday',
|
||||
component: 'CheckboxGroup',
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2',
|
||||
dependencies: {
|
||||
show: (formValue) => formValue.inspectionPlanPeriod == '2',
|
||||
triggerFields: ['inspectionPlanPeriod'],
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '结束日期',
|
||||
fieldName: 'endDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
options: getDictOptions('wy_xq')
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
fieldName: 'startTime',
|
||||
component: 'DatePicker',
|
||||
label: '月',
|
||||
fieldName: 'inspectionMonth',
|
||||
component: 'CheckboxGroup',
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2',
|
||||
dependencies: {
|
||||
show: (formValue) => formValue.inspectionPlanPeriod == '1',
|
||||
triggerFields: ['inspectionPlanPeriod'],
|
||||
},
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
options: Array.from({ length: 12 }, (_, i) => ({
|
||||
label: `${i + 1}月`,
|
||||
value: (i + 1).toString(),
|
||||
})),
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '结束时间',
|
||||
fieldName: 'endTime',
|
||||
component: 'DatePicker',
|
||||
label: '日',
|
||||
fieldName: 'inspectionDay',
|
||||
component: 'CheckboxGroup',
|
||||
rules: 'selectRequired',
|
||||
formItemClass: 'col-span-2',
|
||||
dependencies: {
|
||||
show: (formValue) => formValue.inspectionPlanPeriod == '1',
|
||||
triggerFields: ['inspectionPlanPeriod'],
|
||||
},
|
||||
componentProps: {
|
||||
options: Array.from({ length: 31 }, (_, i) => ({
|
||||
label: `${i + 1}日`,
|
||||
value: (i + 1).toString(),
|
||||
})),
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '计划日期',
|
||||
fieldName: 'planDate',
|
||||
component: 'RangePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
@ -200,21 +214,35 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: '允许补检',
|
||||
fieldName: 'canReexamine',
|
||||
component: 'Select',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_sf'),
|
||||
buttonStyle: 'solid',
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '选择员工',
|
||||
label: '巡检人员',
|
||||
fieldName: 'userId',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
component: 'ApiSelect',
|
||||
componentProps:{
|
||||
mode: 'multiple',
|
||||
},
|
||||
rules: z.array(z.string()).min(1, { message: '请选择巡检人员' }),
|
||||
formItemClass: 'col-span-2'
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Input',
|
||||
component: 'Textarea',
|
||||
formItemClass: 'col-span-2'
|
||||
},
|
||||
];
|
||||
|
||||
const weekOptions = (): any[] => {
|
||||
let arr: any[] = []
|
||||
for (let i = 1; i <= 7; i++) {
|
||||
arr.push({label: '星期' + '', value: i})
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
@ -1,14 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
@ -18,13 +12,16 @@ import {
|
||||
import {
|
||||
inspectionPlanExport,
|
||||
inspectionPlanList,
|
||||
inspectionPlanRemove,
|
||||
inspectionPlanRemove, inspectionPlanUpdate,
|
||||
} from '#/api/property/inspectionManagement/inspectionPlan';
|
||||
import type { InspectionPlanForm } from '#/api/property/inspectionManagement/inspectionPlan/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionPlanModal from './inspectionPlan-modal.vue';
|
||||
import inspectionPlanDetail from './plan-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
import {TableSwitch} from "#/components/table";
|
||||
import {useAccess} from "@vben/access";
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@ -35,15 +32,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@ -55,8 +43,6 @@ const gridOptions: VxeGridProps = {
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
@ -87,11 +73,18 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||
const [InspectionPlanModal, modalApi] = useVbenModal({
|
||||
connectedComponent: inspectionPlanModal,
|
||||
});
|
||||
const [InspectionPlanDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: inspectionPlanDetail,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
function handleInfo(row: Required<InspectionPlanForm>) {
|
||||
detailApi.setData({ id: row.id });
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<InspectionPlanForm>) {
|
||||
modalApi.setData({ id: row.id });
|
||||
@ -122,6 +115,7 @@ function handleDownloadExcel() {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
const { hasAccessByCodes } = useAccess();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -154,6 +148,12 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionPlan:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:inspectionPlan:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
@ -176,7 +176,20 @@ function handleDownloadExcel() {
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
</template>
|
||||
<template #state="{row}">
|
||||
<TableSwitch
|
||||
checkedValue="0"
|
||||
unCheckedValue="1"
|
||||
checkedText="启用"
|
||||
unCheckedText="停用"
|
||||
v-model:value="row.state"
|
||||
:api="() => inspectionPlanUpdate(row)"
|
||||
:disabled="!hasAccessByCodes(['property:inspectionPlan:edit'])"
|
||||
@reload="() => tableApi.query()"
|
||||
/>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<InspectionPlanModal @reload="tableApi.query()" />
|
||||
<InspectionPlanDetail/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@ -1,15 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {computed, ref} from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { inspectionPlanAdd, inspectionPlanInfo, inspectionPlanUpdate } from '#/api/property/inspectionManagement/inspectionPlan';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {
|
||||
inspectionPlanAdd,
|
||||
inspectionPlanInfo,
|
||||
inspectionPlanUpdate
|
||||
} from '#/api/property/inspectionManagement/inspectionPlan';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import { modalSchema } from './data';
|
||||
import {modalSchema} from './data';
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
import {inspectionRouteList} from "#/api/property/inspectionManagement/inspectionRoute";
|
||||
import {InputNumber} from 'ant-design-vue'
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@ -21,7 +29,7 @@ const title = computed(() => {
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
@ -34,7 +42,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
@ -43,7 +51,7 @@ const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
class: 'w-[70%]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
@ -53,12 +61,21 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const { id } = modalApi.getData() as { id?: number | string };
|
||||
await queryLineData()
|
||||
await queryPersonData()
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
|
||||
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(',')
|
||||
}
|
||||
record.userId=record.userId?.split(',')
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@ -70,12 +87,26 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (data.planDate && data.planDate.length) {
|
||||
data.startDate = data.planDate[0]
|
||||
data.endDate = data.planDate[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
|
||||
}
|
||||
data.userId=data.userId?.join(',')
|
||||
await (isUpdate.value ? inspectionPlanUpdate(data) : inspectionPlanAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@ -91,11 +122,79 @@ async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
}
|
||||
|
||||
async function queryPersonData() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await personList(params);
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.userName + '-' + renderDictValue(user.gender, 'sys_user_sex')
|
||||
+ '-' + user.phone+'-'+user.unitName,
|
||||
value: user.id,
|
||||
}));
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
showSearch: true,
|
||||
filterOption: filterOption,
|
||||
mode: 'multiple',
|
||||
}),
|
||||
fieldName: 'userId',
|
||||
}])
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询巡检路线数据
|
||||
*/
|
||||
async function queryLineData() {
|
||||
let params = {
|
||||
pageSize: 1000,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await inspectionRouteList(params);
|
||||
const options = res.rows.map((item) => ({
|
||||
label: item.routeName,
|
||||
value: item.id,
|
||||
}));
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
showSearch: true,
|
||||
filterOption: filterOption
|
||||
}),
|
||||
fieldName: 'inspectionRouteId',
|
||||
}])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<BasicForm>
|
||||
<template #beforeTime="slotProps">
|
||||
<div class="before-time">
|
||||
<InputNumber id="inputNumber" v-bind="slotProps" :min="1"/>
|
||||
<span class="tail-text">分钟完成</span>
|
||||
</div>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
.before-time {
|
||||
display: flex;
|
||||
.tail-text {
|
||||
width: 100px;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
line-height:32px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -0,0 +1,107 @@
|
||||
<script setup lang="ts">
|
||||
import {shallowRef} from 'vue';
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
import {renderDict} from "#/utils/render";
|
||||
import {inspectionPlanInfo} from "#/api/property/inspectionManagement/inspectionPlan";
|
||||
import type {InspectionPlanVO} from "#/api/property/inspectionManagement/inspectionPlan/model";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
import {CheckboxGroup} from 'ant-design-vue'
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
inspectionPlanDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const inspectionPlanDetail = shallowRef<null | InspectionPlanVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
const response = await inspectionPlanInfo(id);
|
||||
inspectionPlanDetail.value = response;
|
||||
if (inspectionPlanDetail.value.inspectionPlanPeriod == '1') {
|
||||
inspectionPlanDetail.value.inspectionMonth = inspectionPlanDetail.value.inspectionMonth?.split(',');
|
||||
inspectionPlanDetail.value.inspectionDay = inspectionPlanDetail.value.inspectionDay?.split(',');
|
||||
} else {
|
||||
inspectionPlanDetail.value.inspectionWorkday = inspectionPlanDetail.value.inspectionWorkday?.split(',');
|
||||
}
|
||||
inspectionPlanDetail.value.userId = inspectionPlanDetail.value.userId?.split(',');
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
const dayArr=Array.from({ length: 31 }, (_, i) => ({
|
||||
label: `${i + 1}日`,
|
||||
value: (i + 1).toString(),
|
||||
}));
|
||||
const monthArr=Array.from({ length: 12 }, (_, i) => ({
|
||||
label: `${i + 1}月`,
|
||||
value: (i + 1).toString(),
|
||||
}))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="巡检计划详情" class="w-[70%]">
|
||||
<Descriptions v-if="inspectionPlanDetail" size="small" :column="2" bordered
|
||||
:labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="计划名称">
|
||||
{{ inspectionPlanDetail.planName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="巡检路线">
|
||||
{{ inspectionPlanDetail.inspectionRouteId }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="巡检周期" v-if="inspectionPlanDetail.inspectionPlanPeriod!=null">
|
||||
<component
|
||||
:is="renderDict(inspectionPlanDetail.inspectionPlanPeriod,'wy_xjzq')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="任务提前" v-if="inspectionPlanDetail.beforeTime!=null">
|
||||
<span>{{ inspectionPlanDetail.beforeTime + ' 分钟完成' }}</span>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="周" :span="2" v-if="inspectionPlanDetail.inspectionPlanPeriod=='2'">
|
||||
<CheckboxGroup v-model:value="inspectionPlanDetail.inspectionWorkday"
|
||||
:options="getDictOptions('wy_xq')"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="月" :span="2" v-if="inspectionPlanDetail.inspectionPlanPeriod=='1'">
|
||||
<CheckboxGroup v-model:value="inspectionPlanDetail.inspectionMonth"
|
||||
:options="monthArr"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="日" :span="2" v-if="inspectionPlanDetail.inspectionPlanPeriod=='1'">
|
||||
<CheckboxGroup v-model:value="inspectionPlanDetail.inspectionDay"
|
||||
:options="dayArr"/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="计划日期" :span="2">
|
||||
{{ inspectionPlanDetail.startDate + '\xa0至\xa0' + inspectionPlanDetail.endDate }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="签到方式">
|
||||
<component
|
||||
:is="renderDict(inspectionPlanDetail.signType,'wy_xjqdfs')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="允许补件">
|
||||
<component
|
||||
:is="renderDict(inspectionPlanDetail.canReexamine,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="巡检人员" :span="2">
|
||||
{{ inspectionPlanDetail.projectName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="备注" :span="2">
|
||||
{{ inspectionPlanDetail.remark }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="状态" v-if="inspectionPlanDetail.state!=null">
|
||||
<span>{{ inspectionPlanDetail.state == '1' ? '停用' : '启用' }}</span>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
</template>
|
@ -1,13 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import type { Recordable } from '@vben/types';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
@ -16,12 +10,10 @@ import {
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
inspectionPointExport,
|
||||
inspectionPointList,
|
||||
inspectionPointRemove,
|
||||
} from '#/api/property/inspectionManagement/inspectionPoint';
|
||||
import type { InspectionPointForm } from '#/api/property/inspectionManagement/inspectionPoint/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionPointModal from './inspectionPoint-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
@ -116,12 +108,6 @@ function handleMultiDelete() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionPointExport, '巡检点数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -129,12 +115,6 @@ function handleDownloadExcel() {
|
||||
<BasicTable table-title="巡检点列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:inspectionPoint:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
|
@ -6,7 +6,7 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
component: 'Input',
|
||||
fieldName: 'routeName',
|
||||
label: '路线名称',
|
||||
label: '巡检路线名称',
|
||||
},
|
||||
];
|
||||
|
||||
@ -15,12 +15,16 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '主键id',
|
||||
field: 'id',
|
||||
title: '巡检路线名称',
|
||||
field: 'routeName',
|
||||
},
|
||||
{
|
||||
title: '路线名称',
|
||||
field: 'routeName',
|
||||
title: '创建时间',
|
||||
field: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
field: 'sort',
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
@ -46,14 +50,20 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '路线名称',
|
||||
label: '巡检路线名称',
|
||||
fieldName: 'routeName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '排序',
|
||||
fieldName: 'sort',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
fieldName: 'remark',
|
||||
component: 'Input',
|
||||
component: 'Textarea',
|
||||
},
|
||||
];
|
||||
|
@ -16,19 +16,17 @@ import {
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
inspectionRouteExport,
|
||||
inspectionRouteList,
|
||||
inspectionRouteRemove,
|
||||
} from '#/api/property/inspectionManagement/inspectionRoute';
|
||||
import type { InspectionRouteForm } from '#/api/property/inspectionManagement/inspectionRoute/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import inspectionRouteModal from './inspectionRoute-modal.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
labelWidth: 80,
|
||||
labelWidth: 90,
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
},
|
||||
@ -116,12 +114,6 @@ function handleMultiDelete() {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function handleDownloadExcel() {
|
||||
commonDownloadExcel(inspectionRouteExport, '巡检路线数据', tableApi.formApi.form.values, {
|
||||
fieldMappingTime: formOptions.fieldMappingTime,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@ -129,12 +121,6 @@ function handleDownloadExcel() {
|
||||
<BasicTable table-title="巡检路线列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:inspectionRoute:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
|
@ -23,7 +23,7 @@ const [BasicForm, formApi] = useVbenForm({
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-2',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
labelWidth: 100,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
|
Loading…
Reference in New Issue
Block a user