Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { PageQuery, BaseEntity } from '#/api/common';
|
||||
import {isArray} from "lodash-es";
|
||||
|
||||
export interface ShiftVO {
|
||||
/**
|
||||
@@ -24,7 +25,7 @@ export interface ShiftVO {
|
||||
/**
|
||||
* 状态(0:off,1:on)
|
||||
*/
|
||||
status: number;
|
||||
status: string | number;
|
||||
|
||||
/**
|
||||
* 是否休息(0:不休息,1:休息)
|
||||
@@ -40,6 +41,9 @@ export interface ShiftVO {
|
||||
* 休息结束时间
|
||||
*/
|
||||
restEndTime: string;
|
||||
|
||||
attendanceTimeRange: [any,any];
|
||||
restTimeRange: [any,any];
|
||||
}
|
||||
|
||||
export interface ShiftForm extends BaseEntity {
|
||||
@@ -66,7 +70,7 @@ export interface ShiftForm extends BaseEntity {
|
||||
/**
|
||||
* 状态(0:off,1:on)
|
||||
*/
|
||||
status?: number;
|
||||
status?: string | number;
|
||||
|
||||
/**
|
||||
* 是否休息(0:不休息,1:休息)
|
||||
@@ -103,7 +107,7 @@ export interface ShiftQuery extends PageQuery {
|
||||
/**
|
||||
* 状态(0:off,1:on)
|
||||
*/
|
||||
status?: number;
|
||||
status?: string | number;
|
||||
|
||||
/**
|
||||
* 是否休息(0:不休息,1:休息)
|
||||
|
@@ -34,12 +34,21 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'name',
|
||||
},
|
||||
{
|
||||
title: '考勤开始时间',
|
||||
field: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '考勤结束时间',
|
||||
field: 'endTime',
|
||||
title: '考勤时间',
|
||||
field: 'timeRange',
|
||||
slots: {
|
||||
default: ({ row }) => {
|
||||
const startTime = row.startTime || '';
|
||||
const endTime = row.endTime || '';
|
||||
const restStartTime = row.restStartTime || '';
|
||||
const restEndTime = row.restEndTime || '';
|
||||
if(restStartTime&&restEndTime){
|
||||
return `${startTime} - ${restStartTime} ${restEndTime} - ${endTime}`;
|
||||
}else{
|
||||
return `${startTime} - ${endTime}`;
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
@@ -69,6 +78,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
label: '班次名称',
|
||||
fieldName: 'name',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '考勤时间',
|
||||
@@ -85,8 +95,8 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '不休息', value: '0' },
|
||||
{ label: '休息', value: '1' },
|
||||
{ label: '不休息', value: 0 },
|
||||
{ label: '休息', value: 1 },
|
||||
],
|
||||
},
|
||||
rules: 'required',
|
||||
|
@@ -52,6 +52,18 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
isUpdate.value = !!id;
|
||||
if (isUpdate.value && id) {
|
||||
const record = await shiftInfo(id);
|
||||
record.attendanceTimeRange = [
|
||||
dayjs(record.startTime, 'HH:mm:ss'),
|
||||
dayjs(record.endTime, 'HH:mm:ss')
|
||||
];
|
||||
if(record.restStartTime !== null && record.restEndTime !== null){
|
||||
record.restTimeRange = [
|
||||
dayjs(record.restStartTime, 'HH:mm:ss'),
|
||||
dayjs(record.restEndTime, 'HH:mm:ss')
|
||||
];
|
||||
}
|
||||
record.status = record.status?.toString();
|
||||
console.log(record);
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -69,8 +81,10 @@ async function handleConfirm() {
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
data.startTime = dayjs(data.attendanceTimeRange[0]).format('HH:mm:ss');
|
||||
data.endTime = dayjs(data.attendanceTimeRange[1]).format('HH:mm:ss');
|
||||
data.restStartTime = dayjs(data.restTimeRange[0]).format('HH:mm:ss');
|
||||
data.restEndTime = dayjs(data.restTimeRange[1]).format('HH:mm:ss');
|
||||
if(data.restTimeRange){
|
||||
data.restStartTime = dayjs(data.restTimeRange[0]).format('HH:mm:ss');
|
||||
data.restEndTime = dayjs(data.restTimeRange[1]).format('HH:mm:ss');
|
||||
}
|
||||
delete data.attendanceTimeRange;
|
||||
delete data.restTimeRange;
|
||||
await (isUpdate.value ? shiftUpdate(data) : shiftAdd(data));
|
||||
|
@@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
@@ -96,7 +96,8 @@ export const columns: VxeGridProps['columns'] = [
|
||||
width: 100,
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return renderDict(row.status, 'wy_sf');
|
||||
return row.isTimeOut ? renderDict(row.isTimeOut, 'wy_sf') : '';
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -105,7 +106,7 @@ export const columns: VxeGridProps['columns'] = [
|
||||
fixed: 'right',
|
||||
slots: {default: 'action'},
|
||||
title: '操作',
|
||||
width: 180,
|
||||
width: 300,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -142,38 +143,37 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// },
|
||||
{
|
||||
label: '派单时间',
|
||||
fieldName: 'dispatchTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
disabledDate: disabledDate
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '发起人',
|
||||
fieldName: 'initiatorName',
|
||||
component: 'ApiSelect',
|
||||
formItemClass: 'col-span-2',
|
||||
rules: 'selectRequired',
|
||||
|
||||
},
|
||||
{
|
||||
label: '处理人',
|
||||
fieldName: 'handler',
|
||||
component: 'ApiSelect',
|
||||
formItemClass: 'col-span-2',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
// {
|
||||
// label: '派单时间',
|
||||
// fieldName: 'dispatchTime',
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// disabledDate: disabledDate
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// },
|
||||
// {
|
||||
// label: '发起人',
|
||||
// fieldName: 'initiatorName',
|
||||
// component: 'ApiSelect',
|
||||
// formItemClass: 'col-span-2',
|
||||
// rules: 'selectRequired',
|
||||
//
|
||||
// },
|
||||
// {
|
||||
// label: '处理人',
|
||||
// fieldName: 'handler',
|
||||
// component: 'ApiSelect',
|
||||
// formItemClass: 'col-span-2',
|
||||
// rules: 'selectRequired',
|
||||
// },
|
||||
{
|
||||
label: '具体位置',
|
||||
fieldName: 'location',
|
||||
component: 'Input',
|
||||
formItemClass: 'col-span-2',
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
@@ -188,34 +188,66 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
labelWidth: 110,
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '完成时间',
|
||||
fieldName: 'compleTime',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '评价',
|
||||
fieldName: 'serviceEvalua',
|
||||
component: 'Rate',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '是否超时',
|
||||
fieldName: 'isTimeOut',
|
||||
component: 'RadioGroup',
|
||||
componentProps: {
|
||||
buttonStyle: 'solid',
|
||||
options: getDictOptions('wy_sf'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
// {
|
||||
// label: '完成时间',
|
||||
// fieldName: 'compleTime',
|
||||
// component: 'DatePicker',
|
||||
// componentProps: {
|
||||
// showTime: true,
|
||||
// format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// },
|
||||
// {
|
||||
// label: '评价',
|
||||
// fieldName: 'serviceEvalua',
|
||||
// component: 'Rate',
|
||||
// rules: 'required',
|
||||
// },
|
||||
// {
|
||||
// label: '是否超时',
|
||||
// fieldName: 'isTimeOut',
|
||||
// component: 'RadioGroup',
|
||||
// componentProps: {
|
||||
// buttonStyle: 'solid',
|
||||
// options: getDictOptions('wy_sf'),
|
||||
// },
|
||||
// rules: 'selectRequired',
|
||||
// },
|
||||
];
|
||||
const disabledDate = (current: Dayjs) => {
|
||||
return current && current < dayjs().endOf('day');
|
||||
};
|
||||
export const ordersModalSchema: FormSchemaGetter = () => [
|
||||
{
|
||||
label: 'id',
|
||||
fieldName: 'id',
|
||||
component: 'Input',
|
||||
dependencies: {
|
||||
show: () => false,
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
fieldName: 'status',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('wy_gdclzt'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
disabled: true
|
||||
},
|
||||
{
|
||||
label: '处理人',
|
||||
fieldName: 'handler',
|
||||
component: 'ApiSelect',
|
||||
formItemClass: 'col-span-2',
|
||||
rules: 'selectRequired',
|
||||
dependencies: {
|
||||
disabled: (formValue) =>formValue.status === '2' ,
|
||||
triggerFields: ['status'],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
@@ -1,15 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import {Page, useVbenModal, type VbenFormProps} from '@vben/common-ui';
|
||||
import {getVxePopupContainer} from '@vben/utils';
|
||||
|
||||
import {Modal, Popconfirm, Space, RadioGroup, RadioButton} from 'ant-design-vue';
|
||||
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
type VxeGridProps
|
||||
} from '#/adapter/vxe-table';
|
||||
|
||||
import {
|
||||
workOrdersExport,
|
||||
workOrdersList,
|
||||
@@ -17,9 +14,9 @@ import {
|
||||
} from '#/api/property/businessManagement/workOrders';
|
||||
import type {WorkOrdersForm} from '#/api/property/businessManagement/workOrders/model';
|
||||
import {commonDownloadExcel} from '#/utils/file/download';
|
||||
|
||||
import workOrdersModal from './workOrders-modal.vue';
|
||||
import workOrdersDetail from './work-orders-detail.vue';
|
||||
import ordersModal from './orders-modal.vue';
|
||||
import {columns, querySchema} from './data';
|
||||
import {onMounted, ref} from "vue";
|
||||
import {workOrdersTypeList} from "#/api/property/businessManagement/workOrdersType";
|
||||
@@ -90,15 +87,25 @@ const [WorkOrdersDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: workOrdersDetail,
|
||||
});
|
||||
|
||||
const [OrdersModal, ordersApi] = useVbenModal({
|
||||
connectedComponent: ordersModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
function handleInfo(row:any) {
|
||||
detailApi.setData({id:row.id});
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
function handleOrders(row:any,mean:any) {
|
||||
ordersApi.setData({id:row.id,mean:mean});
|
||||
ordersApi.open();
|
||||
}
|
||||
|
||||
async function handleEdit(row: Required<WorkOrdersForm>) {
|
||||
modalApi.setData({id: row.id});
|
||||
modalApi.open();
|
||||
@@ -188,6 +195,16 @@ onMounted(async () => {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button
|
||||
@click.stop="handleOrders(row,'group')"
|
||||
>
|
||||
{{ '派单' }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
@click.stop="handleOrders(row,'rob')"
|
||||
>
|
||||
{{ '抢单' }}
|
||||
</ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:workOrders:info']"
|
||||
@click.stop="handleInfo(row)"
|
||||
@@ -218,6 +235,7 @@ onMounted(async () => {
|
||||
</template>
|
||||
</BasicTable>
|
||||
<WorkOrdersModal @reload="tableApi.query()"/>
|
||||
<OrdersModal @reload="tableApi.query()"/>
|
||||
<WorkOrdersDetail/>
|
||||
</Page>
|
||||
</template>
|
||||
|
@@ -0,0 +1,133 @@
|
||||
<script setup lang="ts">
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {
|
||||
workOrdersInfo,
|
||||
workOrdersUpdate
|
||||
} from '#/api/property/businessManagement/workOrders';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
import {ordersModalSchema} from './data';
|
||||
import {personList} from "#/api/property/resident/person";
|
||||
import {renderDictValue} from "#/utils/render";
|
||||
import {ref} from "vue";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const [BasicForm, formApi] = useVbenForm({
|
||||
commonConfig: {
|
||||
// 默认占满两列
|
||||
formItemClass: 'col-span-1',
|
||||
// 默认label宽度 px
|
||||
labelWidth: 80,
|
||||
// 通用配置项 会影响到所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
}
|
||||
},
|
||||
schema: ordersModalSchema(),
|
||||
showDefaultActions: false,
|
||||
wrapperClass: 'grid-cols-2',
|
||||
});
|
||||
|
||||
const {onBeforeClose, markInitialized, resetInitialized} = useBeforeCloseDiff(
|
||||
{
|
||||
initializedGetter: defaultFormValueGetter(formApi),
|
||||
currentGetter: defaultFormValueGetter(formApi),
|
||||
},
|
||||
);
|
||||
|
||||
const record = ref({})
|
||||
const title = ref('派单')
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
// 在这里更改宽度
|
||||
class: 'w-[550px]',
|
||||
fullscreenButton: false,
|
||||
onBeforeClose,
|
||||
onClosed: handleClosed,
|
||||
onConfirm: handleConfirm,
|
||||
onOpenChange: async (isOpen) => {
|
||||
if (!isOpen) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
await queryPersonData()
|
||||
const {id} = modalApi.getData() as { id?: number | string };
|
||||
const {mean} = modalApi.getData() as { rob?: number | string };
|
||||
if (id) {
|
||||
record.value = await workOrdersInfo(id);
|
||||
if(mean === 'rob'){
|
||||
title.value = '抢单'
|
||||
record.value.status = '2';
|
||||
record.value.handler = record.value.initiatorPeople;
|
||||
}else{
|
||||
title.value = '派单'
|
||||
record.value.status = '1';
|
||||
record.value.handler = null;
|
||||
}
|
||||
await formApi.setValues(record.value);
|
||||
}
|
||||
await markInitialized();
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
},
|
||||
});
|
||||
|
||||
async function handleConfirm() {
|
||||
try {
|
||||
modalApi.lock(true);
|
||||
const {valid} = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
record.value.handler = data.handler
|
||||
await workOrdersUpdate(record.value)
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
} finally {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
value: user.id,
|
||||
}));
|
||||
formApi.updateSchema([
|
||||
{
|
||||
componentProps: () => ({
|
||||
options: options,
|
||||
showSearch:true,
|
||||
filterOption: filterOption
|
||||
}),
|
||||
fieldName: 'handler',
|
||||
}])
|
||||
}
|
||||
|
||||
const filterOption = (input: string, option: any) => {
|
||||
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm/>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
@@ -1,14 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {ref, shallowRef} from 'vue';
|
||||
|
||||
import {computed, 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";
|
||||
@@ -30,22 +26,17 @@ async function handleOpenChange(open: boolean) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
orderDetail.value = await workOrdersInfo(id);
|
||||
if(orderDetail.value){
|
||||
handleRecords.value=[
|
||||
{type:orderDetail.value.typeName,time:orderDetail.value.compleTime,personName:orderDetail.value.handlerText},
|
||||
{type:'跟进',time:orderDetail.value.dispatchTime,personName:orderDetail.value.initiatorNameText},
|
||||
{type:'创建工单',time:orderDetail.value.createTime,personName:orderDetail.value.initiatorNameText},
|
||||
]
|
||||
handleRecords.value = orderDetail.value.workOrdersRecordVoList.map( (item, index) => ({
|
||||
status: item.status,
|
||||
createTime: item.createTime,
|
||||
handlerName: index === 0 ? item.initiatorPeople : item.handlerName
|
||||
}))
|
||||
}
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -62,7 +53,7 @@ async function handleOpenChange(open: boolean) {
|
||||
{{orderDetail.typeName}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="发起人">
|
||||
{{ orderDetail.initiatorNameText+'-'+orderDetail.initiatorPhone}}
|
||||
{{ orderDetail.initiatorPeople }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="派单时间">
|
||||
{{ orderDetail.dispatchTime }}
|
||||
@@ -84,18 +75,21 @@ async function handleOpenChange(open: boolean) {
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="是否超时">
|
||||
<component
|
||||
:is="renderDict(orderDetail.isTimeOut,'wy_sf')"
|
||||
:is="orderDetail.isTimeOut ? renderDict(orderDetail.isTimeOut,'wy_sf') : ''"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
<Divider orientation="left" orientation-margin="0px">
|
||||
处理记录
|
||||
</Divider>
|
||||
<Timeline v-if="handleRecords.length">
|
||||
<TimelineItem v-for="item in handleRecords">
|
||||
<p>类型:{{item.type}}</p>
|
||||
<p>时间:{{item.time}}</p>
|
||||
<p>处理人:{{item.personName}}</p>
|
||||
<Timeline>
|
||||
<TimelineItem v-for="(item,index) in handleRecords" :key="index">
|
||||
<p style="display: flex;">类型:
|
||||
<component
|
||||
:is="renderDict(item.status,'wy_gdclzt')"
|
||||
/></p>
|
||||
<p>时间:{{item.createTime}}</p>
|
||||
<p>处理人:{{item.handlerName}}</p>
|
||||
</TimelineItem>
|
||||
</Timeline>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user