This commit is contained in:
@@ -2,6 +2,8 @@ import type {FormSchemaGetter} from '#/adapter/form';
|
|||||||
import type {VxeGridProps} from '#/adapter/vxe-table';
|
import type {VxeGridProps} from '#/adapter/vxe-table';
|
||||||
import {renderDict} from "#/utils/render";
|
import {renderDict} from "#/utils/render";
|
||||||
import {getDictOptions} from "#/utils/dict";
|
import {getDictOptions} from "#/utils/dict";
|
||||||
|
import {h} from "vue";
|
||||||
|
import {Rate} from "ant-design-vue";
|
||||||
|
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
@@ -15,12 +17,6 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
fieldName: 'orderName',
|
fieldName: 'orderName',
|
||||||
label: '工单名称',
|
label: '工单名称',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {},
|
|
||||||
fieldName: 'type',
|
|
||||||
label: '工单类型',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
@@ -44,13 +40,8 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
minWidth: 180,
|
minWidth: 180,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '工单类型',
|
title: '派单时间',
|
||||||
field: 'type',
|
field: 'dispatchTime',
|
||||||
slots: {
|
|
||||||
default: ({row}) => {
|
|
||||||
return renderDict(row.type, 'wy_gdlx');
|
|
||||||
},
|
|
||||||
},
|
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -63,26 +54,6 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
},
|
},
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '派单时间',
|
|
||||||
field: 'dispatchTime',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '发起人姓名',
|
|
||||||
field: 'initiatorName',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '发起人手机号',
|
|
||||||
field: 'initiatorPhone',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '处理人姓名',
|
|
||||||
field: 'handler',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: '地址',
|
title: '地址',
|
||||||
field: 'location',
|
field: 'location',
|
||||||
@@ -101,12 +72,26 @@ export const columns: VxeGridProps['columns'] = [
|
|||||||
{
|
{
|
||||||
title: '评价',
|
title: '评价',
|
||||||
field: 'serviceEvalua',
|
field: 'serviceEvalua',
|
||||||
width: 100,
|
width: 180,
|
||||||
|
slots:{
|
||||||
|
default: ({ row }) => {
|
||||||
|
return h(Rate, {
|
||||||
|
value: row.serviceEvalua || 0,
|
||||||
|
disabled: true,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '是否超时',
|
title: '是否超时',
|
||||||
field: 'isTimeOut',
|
field: 'isTimeOut',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
slots: {
|
||||||
|
default: ({row}) => {
|
||||||
|
return renderDict(row.status, 'wy_sf');
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'action',
|
field: 'action',
|
||||||
@@ -136,7 +121,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
{
|
{
|
||||||
label: '工单类型',
|
label: '工单类型',
|
||||||
fieldName: 'type',
|
fieldName: 'type',
|
||||||
component: 'Select',
|
component: 'ApiSelect',
|
||||||
componentProps: {},
|
componentProps: {},
|
||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
@@ -169,11 +154,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
rules: 'selectRequired',
|
rules: 'selectRequired',
|
||||||
|
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// label: '发起人手机号',
|
|
||||||
// fieldName: 'initiatorPhone',
|
|
||||||
// component: 'Input',
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
label: '处理人',
|
label: '处理人',
|
||||||
fieldName: 'handler',
|
fieldName: 'handler',
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||||
import {getVxePopupContainer} from '@vben/utils';
|
import {getVxePopupContainer} from '@vben/utils';
|
||||||
|
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import {Modal, Popconfirm, Space, RadioGroup, RadioButton} from 'ant-design-vue';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
@@ -19,8 +19,13 @@ import type { WorkOrdersForm } from '#/api/property/businessManagement/workOrder
|
|||||||
import {commonDownloadExcel} from '#/utils/file/download';
|
import {commonDownloadExcel} from '#/utils/file/download';
|
||||||
|
|
||||||
import workOrdersModal from './workOrders-modal.vue';
|
import workOrdersModal from './workOrders-modal.vue';
|
||||||
|
import workOrdersDetail from './work-orders-detail.vue';
|
||||||
import {columns, querySchema} from './data';
|
import {columns, querySchema} from './data';
|
||||||
|
import {onMounted, ref} from "vue";
|
||||||
|
import {workOrdersTypeList} from "#/api/property/businessManagement/workOrdersType";
|
||||||
|
|
||||||
|
const ordersTypeList = ref<any[]>([]);
|
||||||
|
const ordersType = ref<string>('0');
|
||||||
const formOptions: VbenFormProps = {
|
const formOptions: VbenFormProps = {
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
@@ -41,8 +46,6 @@ const gridOptions: VxeGridProps = {
|
|||||||
// 点击行选中
|
// 点击行选中
|
||||||
// trigger: 'row',
|
// trigger: 'row',
|
||||||
},
|
},
|
||||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
|
||||||
// columns: columns(),
|
|
||||||
columns,
|
columns,
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
keepSource: true,
|
keepSource: true,
|
||||||
@@ -74,10 +77,18 @@ const [WorkOrdersModal, modalApi] = useVbenModal({
|
|||||||
connectedComponent: workOrdersModal,
|
connectedComponent: workOrdersModal,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const [WorkOrdersDetail, detailApi] = useVbenModal({
|
||||||
|
connectedComponent: workOrdersDetail,
|
||||||
|
});
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
modalApi.setData({});
|
modalApi.setData({});
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
function handleInfo(row) {
|
||||||
|
detailApi.setData({id:row.id});
|
||||||
|
detailApi.open();
|
||||||
|
}
|
||||||
|
|
||||||
async function handleEdit(row: Required<WorkOrdersForm>) {
|
async function handleEdit(row: Required<WorkOrdersForm>) {
|
||||||
modalApi.setData({id: row.id});
|
modalApi.setData({id: row.id});
|
||||||
@@ -108,11 +119,46 @@ function handleDownloadExcel() {
|
|||||||
fieldMappingTime: formOptions.fieldMappingTime,
|
fieldMappingTime: formOptions.fieldMappingTime,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function queryOrderType() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1
|
||||||
|
}
|
||||||
|
const res = await workOrdersTypeList(params)
|
||||||
|
ordersTypeList.value = res.rows.map((item) => ({
|
||||||
|
label: item.orderTypeName,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
ordersTypeList.value.unshift({
|
||||||
|
label: '全部工单',
|
||||||
|
value: '0',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
await queryOrderType()
|
||||||
|
});
|
||||||
|
|
||||||
|
async function changeOrdersType(val: string) {
|
||||||
|
await tableApi.formApi.setValues({
|
||||||
|
type: val === '0' ? undefined : val, // '0' 表示全部工单,传 undefined 或清除该字段
|
||||||
|
});
|
||||||
|
console.log(tableApi.formApi.getValues(),'==================')
|
||||||
|
await tableApi.query()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page :auto-content-height="true">
|
<Page :auto-content-height="true">
|
||||||
<BasicTable table-title="工单处理列表">
|
<BasicTable table-title="工单处理列表">
|
||||||
|
<template #table-title>
|
||||||
|
<RadioGroup v-model:value="ordersType" button-style="solid" @change="changeOrdersType">
|
||||||
|
<RadioButton v-for="item in ordersTypeList"
|
||||||
|
:value="item.value">{{ item.label }}
|
||||||
|
</RadioButton>
|
||||||
|
</RadioGroup>
|
||||||
|
</template>
|
||||||
<template #toolbar-tools>
|
<template #toolbar-tools>
|
||||||
<Space>
|
<Space>
|
||||||
<a-button
|
<a-button
|
||||||
@@ -140,6 +186,12 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<Space>
|
<Space>
|
||||||
|
<ghost-button
|
||||||
|
v-access:code="['property:workOrders:info']"
|
||||||
|
@click.stop="handleInfo(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.info') }}
|
||||||
|
</ghost-button>
|
||||||
<ghost-button
|
<ghost-button
|
||||||
v-access:code="['property:workOrders:edit']"
|
v-access:code="['property:workOrders:edit']"
|
||||||
@click.stop="handleEdit(row)"
|
@click.stop="handleEdit(row)"
|
||||||
@@ -164,5 +216,6 @@ function handleDownloadExcel() {
|
|||||||
</template>
|
</template>
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<WorkOrdersModal @reload="tableApi.query()"/>
|
<WorkOrdersModal @reload="tableApi.query()"/>
|
||||||
|
<WorkOrdersDetail/>
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@@ -0,0 +1,98 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
|
||||||
|
import {ref, shallowRef} from 'vue';
|
||||||
|
|
||||||
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
|
|
||||||
|
import {Descriptions, DescriptionsItem, Timeline, TimelineItem, Rate,Divider} 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 {workOrdersInfo} from "#/api/property/businessManagement/workOrders";
|
||||||
|
import type {WorkOrdersVO} from "#/api/property/businessManagement/workOrders/model";
|
||||||
|
|
||||||
|
dayjs.extend(duration);
|
||||||
|
dayjs.extend(relativeTime);
|
||||||
|
|
||||||
|
const [BasicModal, modalApi] = useVbenModal({
|
||||||
|
onOpenChange: handleOpenChange,
|
||||||
|
onClosed() {
|
||||||
|
orderDetail.value = null;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const orderDetail = shallowRef<null | WorkOrdersVO>(null);
|
||||||
|
|
||||||
|
async function handleOpenChange(open: boolean) {
|
||||||
|
if (!open) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
modalApi.modalLoading(true);
|
||||||
|
|
||||||
|
const {id} = modalApi.getData() as { id: number | string };
|
||||||
|
// 赋值
|
||||||
|
orderDetail.value = await workOrdersInfo(id);
|
||||||
|
|
||||||
|
modalApi.modalLoading(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<BasicModal :footer="false" :fullscreen-button="false" title="工单详情信息" class="w-[70%]">
|
||||||
|
<div v-if="orderDetail">
|
||||||
|
<Descriptions size="small" :column="2" :labelStyle="{width:'100px'}">
|
||||||
|
<DescriptionsItem label="订单号">
|
||||||
|
{{ orderDetail.orderNo }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="工单名称">
|
||||||
|
{{ orderDetail.orderName }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="工单类型">
|
||||||
|
<component
|
||||||
|
:is="renderDict(orderDetail.customerType,'wy_khlx')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="发起人">
|
||||||
|
{{ orderDetail.rentalPeriod }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="派单时间">
|
||||||
|
{{ orderDetail.dispatchTime }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="处理人">
|
||||||
|
{{ orderDetail.totalAmount + "元" }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="具体位置" :span="2">
|
||||||
|
{{ orderDetail.location }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="计划完成时间">
|
||||||
|
{{ orderDetail.planCompleTime }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="完成时间">
|
||||||
|
{{ orderDetail.compleTime }}
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="评价">
|
||||||
|
<Rate :value="orderDetail.serviceEvalua" disabled/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
<DescriptionsItem label="是否超时">
|
||||||
|
<component
|
||||||
|
:is="renderDict(orderDetail.isTimeOut,'wy_sf')"
|
||||||
|
/>
|
||||||
|
</DescriptionsItem>
|
||||||
|
</Descriptions>
|
||||||
|
<Divider orientation="left" orientation-margin="0px">
|
||||||
|
处理记录
|
||||||
|
</Divider>
|
||||||
|
<Timeline>
|
||||||
|
<TimelineItem>
|
||||||
|
<p>类型:</p>
|
||||||
|
<p>时间:</p>
|
||||||
|
<p>处理人:</p>
|
||||||
|
</TimelineItem>
|
||||||
|
</Timeline>
|
||||||
|
</div>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
@@ -16,6 +16,7 @@ import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
|||||||
import {modalSchema} from './data';
|
import {modalSchema} from './data';
|
||||||
import {personList} from "#/api/property/resident/person";
|
import {personList} from "#/api/property/resident/person";
|
||||||
import {renderDictValue} from "#/utils/render";
|
import {renderDictValue} from "#/utils/render";
|
||||||
|
import {workOrdersTypeList} from "#/api/property/businessManagement/workOrdersType";
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
|
|
||||||
@@ -60,11 +61,13 @@ const [BasicModal, modalApi] = useVbenModal({
|
|||||||
}
|
}
|
||||||
modalApi.modalLoading(true);
|
modalApi.modalLoading(true);
|
||||||
await queryPersonData()
|
await queryPersonData()
|
||||||
|
await queryWorkOrdersType()
|
||||||
const {id} = modalApi.getData() as { id?: number | string };
|
const {id} = modalApi.getData() as { id?: number | string };
|
||||||
isUpdate.value = !!id;
|
isUpdate.value = !!id;
|
||||||
|
|
||||||
if (isUpdate.value && id) {
|
if (isUpdate.value && id) {
|
||||||
const record = await workOrdersInfo(id);
|
const record = await workOrdersInfo(id);
|
||||||
|
record.isTimeOut=record.isTimeOut.toString()
|
||||||
await formApi.setValues(record);
|
await formApi.setValues(record);
|
||||||
}
|
}
|
||||||
await markInitialized();
|
await markInitialized();
|
||||||
@@ -111,6 +114,7 @@ async function queryPersonData() {
|
|||||||
formApi.updateSchema([{
|
formApi.updateSchema([{
|
||||||
componentProps: () => ({
|
componentProps: () => ({
|
||||||
options: options,
|
options: options,
|
||||||
|
showSearch:true,
|
||||||
filterOption: filterOption
|
filterOption: filterOption
|
||||||
}),
|
}),
|
||||||
fieldName: 'initiatorName',
|
fieldName: 'initiatorName',
|
||||||
@@ -118,14 +122,35 @@ async function queryPersonData() {
|
|||||||
{
|
{
|
||||||
componentProps: () => ({
|
componentProps: () => ({
|
||||||
options: options,
|
options: options,
|
||||||
|
showSearch:true,
|
||||||
filterOption: filterOption
|
filterOption: filterOption
|
||||||
}),
|
}),
|
||||||
fieldName: 'handler',
|
fieldName: 'handler',
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function queryWorkOrdersType() {
|
||||||
|
let params = {
|
||||||
|
pageSize: 1000,
|
||||||
|
pageNum: 1
|
||||||
|
}
|
||||||
|
const res = await workOrdersTypeList(params)
|
||||||
|
const options = res.rows.map((item) => ({
|
||||||
|
label: item.orderTypeName,
|
||||||
|
value: item.id,
|
||||||
|
}));
|
||||||
|
formApi.updateSchema([{
|
||||||
|
componentProps: () => ({
|
||||||
|
options: options,
|
||||||
|
filterOption: filterOption,
|
||||||
|
showSearch:true,
|
||||||
|
}),
|
||||||
|
fieldName: 'type',
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
const filterOption = (input: string, option: any) => {
|
const filterOption = (input: string, option: any) => {
|
||||||
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@@ -152,14 +152,15 @@ async function queryUnitData() {
|
|||||||
formApi.updateSchema([{
|
formApi.updateSchema([{
|
||||||
componentProps: () => ({
|
componentProps: () => ({
|
||||||
options: options,
|
options: options,
|
||||||
filterOption: filterOption
|
filterOption: filterOption,
|
||||||
|
showSearch:true,
|
||||||
}),
|
}),
|
||||||
fieldName: 'unit',
|
fieldName: 'unit',
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterOption = (input: string, option: any) => {
|
const filterOption = (input: string, option: any) => {
|
||||||
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
async function changeProjectNum() {
|
async function changeProjectNum() {
|
||||||
|
@@ -122,14 +122,15 @@ async function queryPerson() {
|
|||||||
formApi.updateSchema([{
|
formApi.updateSchema([{
|
||||||
componentProps: () => ({
|
componentProps: () => ({
|
||||||
options: options,
|
options: options,
|
||||||
filterOption: filterOption
|
filterOption: filterOption,
|
||||||
|
showSearch:true,
|
||||||
}),
|
}),
|
||||||
fieldName: 'principals',
|
fieldName: 'principals',
|
||||||
}])
|
}])
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterOption = (input: string, option: any) => {
|
const filterOption = (input: string, option: any) => {
|
||||||
return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user