2、退费审核 3、房间添加套内面积
This commit is contained in:
@@ -42,16 +42,16 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'machineBrand',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
field: 'machineTypeId',
|
||||
width:100
|
||||
},
|
||||
{
|
||||
title: '位置详情',
|
||||
field: 'locationId',
|
||||
width:100
|
||||
},
|
||||
// {
|
||||
// title: '设备类型',
|
||||
// field: 'machineTypeId',
|
||||
// width:100
|
||||
// },
|
||||
// {
|
||||
// title: '位置详情',
|
||||
// field: 'locationId',
|
||||
// width:100
|
||||
// },
|
||||
{
|
||||
title: '采购价格',
|
||||
field: 'purchasePrice',
|
||||
@@ -92,11 +92,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '责任人',
|
||||
field: 'personId',
|
||||
width:100
|
||||
},
|
||||
// {
|
||||
// title: '责任人',
|
||||
// field: 'personId',
|
||||
// width:100
|
||||
// },
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
|
@@ -24,7 +24,7 @@ import MachineTypeTree from '../components/machine-type-tree.vue'
|
||||
import machineDetail from './machine-detail.vue'
|
||||
import {ref} from "vue";
|
||||
|
||||
const selectTypeId = ref('')
|
||||
const selectTypeId = ref([])
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
commonConfig: {
|
||||
@@ -36,8 +36,8 @@ const formOptions: VbenFormProps = {
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
handleReset: async () => {
|
||||
selectTypeId.value = '';
|
||||
const { formApi, reload } = tableApi;
|
||||
selectTypeId.value = [];
|
||||
const {formApi, reload} = tableApi;
|
||||
await formApi.resetForm();
|
||||
const formValues = formApi.form.values;
|
||||
formApi.setLatestSubmissionValues(formValues);
|
||||
@@ -61,7 +61,11 @@ const gridOptions: VxeGridProps = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
formValues.machineTypeId = selectTypeId.value
|
||||
if (selectTypeId.value && selectTypeId.value.length) {
|
||||
formValues.machineTypeId = selectTypeId.value[0]
|
||||
}else {
|
||||
formValues.machineTypeId =[]
|
||||
}
|
||||
return await machineList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -135,32 +139,32 @@ function handleDownloadExcel() {
|
||||
<Page :auto-content-height="true">
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<MachineTypeTree
|
||||
v-model:select-dept-id="selectTypeId"
|
||||
class="w-[260px]"
|
||||
@reload="() => tableApi.reload()"
|
||||
@select="() => tableApi.reload()"
|
||||
v-model:select-dept-id="selectTypeId"
|
||||
class="w-[260px]"
|
||||
@reload="() => tableApi.reload()"
|
||||
@select="() => tableApi.reload()"
|
||||
/>
|
||||
<BasicTable class="flex-1 overflow-hidden" table-title="设备列表列表">
|
||||
<template #toolbar-tools>
|
||||
<Space>
|
||||
<a-button
|
||||
v-access:code="['property:machine:export']"
|
||||
@click="handleDownloadExcel"
|
||||
v-access:code="['property:machine:export']"
|
||||
@click="handleDownloadExcel"
|
||||
>
|
||||
{{ $t('pages.common.export') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:machine:remove']"
|
||||
@click="handleMultiDelete">
|
||||
:disabled="!vxeCheckboxChecked(tableApi)"
|
||||
danger
|
||||
type="primary"
|
||||
v-access:code="['property:machine:remove']"
|
||||
@click="handleMultiDelete">
|
||||
{{ $t('pages.common.delete') }}
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
v-access:code="['property:machine:add']"
|
||||
@click="handleAdd"
|
||||
type="primary"
|
||||
v-access:code="['property:machine:add']"
|
||||
@click="handleAdd"
|
||||
>
|
||||
{{ $t('pages.common.add') }}
|
||||
</a-button>
|
||||
@@ -169,27 +173,27 @@ function handleDownloadExcel() {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
v-access:code="['property:machine:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
v-access:code="['property:machine:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
>
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:machine:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
v-access:code="['property:machine:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:machine:remove']"
|
||||
@click.stop=""
|
||||
danger
|
||||
v-access:code="['property:machine:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
|
@@ -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 = () => [
|
||||
@@ -22,10 +23,6 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{type: 'checkbox', width: 60},
|
||||
{
|
||||
title: '主键',
|
||||
field: 'id',
|
||||
},
|
||||
{
|
||||
title: '计划名称',
|
||||
field: 'planName',
|
||||
@@ -34,10 +31,10 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '计划编号',
|
||||
field: 'planNo',
|
||||
},
|
||||
{
|
||||
title: '设备类型',
|
||||
field: 'machineTypeId',
|
||||
},
|
||||
// {
|
||||
// title: '设备类型',
|
||||
// field: 'machineTypeId',
|
||||
// },
|
||||
{
|
||||
title: '保养周期',
|
||||
field: 'planPeriod',
|
||||
@@ -179,31 +176,14 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules:'required'
|
||||
},
|
||||
// {
|
||||
// label: '开始时间',
|
||||
// fieldName: 'startDate',
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// },
|
||||
// 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'
|
||||
// },
|
||||
// {
|
||||
// label: '状态(0启用,1停用)',
|
||||
// fieldName: 'state',
|
||||
// component: 'Input',
|
||||
// },
|
||||
{
|
||||
label: '巡检人员',
|
||||
fieldName: 'userId',
|
||||
component: 'ApiSelect',
|
||||
componentProps:{
|
||||
mode: 'multiple',
|
||||
},
|
||||
rules: z.array(z.string()).min(1, { message: '请选择巡检人员' }),
|
||||
formItemClass: 'col-span-2'
|
||||
},
|
||||
];
|
||||
|
@@ -182,8 +182,8 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #state="{row}">
|
||||
<TableSwitch
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
checkedValue="1"
|
||||
unCheckedValue="0"
|
||||
v-model:value="row.state"
|
||||
:api="() => maintainPlanUpdate(row)"
|
||||
:disabled="!hasAccessByCodes(['property:depot:edit'])"
|
||||
|
@@ -15,6 +15,8 @@ import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import {modalSchema} from './data';
|
||||
import {getMachineTypeTree} from "#/api/property/machineType";
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
@@ -62,12 +64,16 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
isUpdate.value = !!id;
|
||||
await setupTypeSelect();
|
||||
await queryPersonData()
|
||||
if (isUpdate.value && id) {
|
||||
const record = await maintainPlanInfo(id);
|
||||
record.planDate = [record.startDate, record.endDate]
|
||||
if (record.planPeriod == '1') {
|
||||
record.maintainanceMonth = record.maintainanceMonth?.split(',')
|
||||
record.maintainanceDay = record.maintainanceDay?.split(',')
|
||||
record.maintainMonth = record.maintainMonth?.split(',')
|
||||
record.maintainDay = record.maintainDay?.split(',')
|
||||
}
|
||||
if (record.machineMaintainPlanStaffBoList) {
|
||||
record.userId = record.machineMaintainPlanStaffBoList.map(item=>item.userId)
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
@@ -91,13 +97,19 @@ async function handleConfirm() {
|
||||
data.endDate = data.planDate[1]
|
||||
}
|
||||
if (data.planPeriod == '1') {
|
||||
data.maintainanceMonth = data.maintainanceMonth?.join(',')
|
||||
data.maintainanceDay = data.maintainanceDay?.join(',')
|
||||
data.maintainanceEveryday = undefined
|
||||
data.maintainMonth = data.maintainMonth?.join(',')
|
||||
data.maintainDay = data.maintainDay?.join(',')
|
||||
data.maintainEveryday = undefined
|
||||
} else {
|
||||
data.maintainanceMonth = undefined
|
||||
data.maintainanceDay = undefined
|
||||
data.maintainMonth = undefined
|
||||
data.maintainDay = undefined
|
||||
}
|
||||
data.machineMaintainPlanStaffBoList = []
|
||||
data.userId.forEach((item: string) => {
|
||||
data.machineMaintainPlanStaffBoList.push({
|
||||
userId: item
|
||||
})
|
||||
})
|
||||
await (isUpdate.value ? maintainPlanUpdate(data) : maintainPlanAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -143,6 +155,29 @@ async function setupTypeSelect() {
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
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,
|
||||
optionFilterProp: 'label',
|
||||
optionLabelProp: 'label',
|
||||
mode: 'multiple',
|
||||
}),
|
||||
fieldName: 'userId',
|
||||
}])
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
Reference in New Issue
Block a user