This commit is contained in:
@@ -4,6 +4,8 @@ import {renderDict} from "#/utils/render";
|
||||
import {getDictOptions} from "#/utils/dict";
|
||||
import {h} from "vue";
|
||||
import {Rate} from "ant-design-vue";
|
||||
import type {Dayjs} from "dayjs";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
@@ -39,6 +41,11 @@ export const columns: VxeGridProps['columns'] = [
|
||||
field: 'orderName',
|
||||
minWidth: 180,
|
||||
},
|
||||
{
|
||||
title: '工单类型',
|
||||
field: 'typeName',
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
title: '派单时间',
|
||||
field: 'dispatchTime',
|
||||
@@ -73,8 +80,8 @@ export const columns: VxeGridProps['columns'] = [
|
||||
title: '评价',
|
||||
field: 'serviceEvalua',
|
||||
width: 180,
|
||||
slots:{
|
||||
default: ({ row }) => {
|
||||
slots: {
|
||||
default: ({row}) => {
|
||||
return h(Rate, {
|
||||
value: row.serviceEvalua || 0,
|
||||
disabled: true,
|
||||
@@ -143,6 +150,7 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
disabledDate: disabledDate
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
@@ -208,3 +216,6 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
];
|
||||
const disabledDate = (current: Dayjs) => {
|
||||
return current && current < dayjs().endOf('day');
|
||||
};
|
||||
|
@@ -35,6 +35,14 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
handleReset: async () => {
|
||||
ordersType.value = '0';
|
||||
const { formApi, reload } = tableApi;
|
||||
await formApi.resetForm();
|
||||
const formValues = formApi.form.values;
|
||||
formApi.setLatestSubmissionValues(formValues);
|
||||
await reload(formValues);
|
||||
},
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@@ -53,6 +61,7 @@ const gridOptions: VxeGridProps = {
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
query: async ({page}, formValues = {}) => {
|
||||
formValues.type = ordersType.value=='0'?undefined:ordersType.value;
|
||||
return await workOrdersList({
|
||||
pageNum: page.currentPage,
|
||||
pageSize: page.pageSize,
|
||||
@@ -85,7 +94,7 @@ function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
function handleInfo(row) {
|
||||
function handleInfo(row:any) {
|
||||
detailApi.setData({id:row.id});
|
||||
detailApi.open();
|
||||
}
|
||||
@@ -139,21 +148,14 @@ async function queryOrderType() {
|
||||
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>
|
||||
|
||||
<template>
|
||||
<Page :auto-content-height="true">
|
||||
<BasicTable table-title="工单处理列表">
|
||||
<BasicTable table-title="工单处理列表" class="order-work-left-radio">
|
||||
<template #table-title>
|
||||
<RadioGroup v-model:value="ordersType" button-style="solid" @change="changeOrdersType">
|
||||
<RadioGroup v-model:value="ordersType" button-style="solid"
|
||||
@change="() => tableApi.reload()">
|
||||
<RadioButton v-for="item in ordersTypeList"
|
||||
:value="item.value">{{ item.label }}
|
||||
</RadioButton>
|
||||
@@ -219,3 +221,18 @@ async function changeOrdersType(val: string) {
|
||||
<WorkOrdersDetail/>
|
||||
</Page>
|
||||
</template>
|
||||
<style lang="scss" scoped>
|
||||
:where(.css-dev-only-do-not-override-aza1th).ant-radio-group {
|
||||
white-space: nowrap;
|
||||
overflow-y: hidden;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<style lang="scss">
|
||||
.order-work-left-radio{
|
||||
.vxe-toolbar .vxe-buttons--wrapper, .vxe-toolbar .vxe-tools--wrapper {
|
||||
max-width: 70% !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -24,7 +24,7 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
});
|
||||
|
||||
const orderDetail = shallowRef<null | WorkOrdersVO>(null);
|
||||
|
||||
const handleRecords=ref<any[]>([])
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
@@ -34,6 +34,13 @@ async function handleOpenChange(open: boolean) {
|
||||
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},
|
||||
]
|
||||
}
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
@@ -52,18 +59,16 @@ async function handleOpenChange(open: boolean) {
|
||||
{{ orderDetail.orderName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="工单类型">
|
||||
<component
|
||||
:is="renderDict(orderDetail.customerType,'wy_khlx')"
|
||||
/>
|
||||
{{orderDetail.typeName}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="发起人">
|
||||
{{ orderDetail.rentalPeriod }}
|
||||
{{ orderDetail.initiatorNameText+'-'+orderDetail.initiatorPhone}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="派单时间">
|
||||
{{ orderDetail.dispatchTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="处理人">
|
||||
{{ orderDetail.totalAmount + "元" }}
|
||||
{{ orderDetail.handlerText }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="具体位置" :span="2">
|
||||
{{ orderDetail.location }}
|
||||
@@ -74,7 +79,7 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="完成时间">
|
||||
{{ orderDetail.compleTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="评价">
|
||||
<DescriptionsItem label="服务评价">
|
||||
<Rate :value="orderDetail.serviceEvalua" disabled/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="是否超时">
|
||||
@@ -86,11 +91,11 @@ async function handleOpenChange(open: boolean) {
|
||||
<Divider orientation="left" orientation-margin="0px">
|
||||
处理记录
|
||||
</Divider>
|
||||
<Timeline>
|
||||
<TimelineItem>
|
||||
<p>类型:</p>
|
||||
<p>时间:</p>
|
||||
<p>处理人:</p>
|
||||
<Timeline v-if="handleRecords.length">
|
||||
<TimelineItem v-for="item in handleRecords">
|
||||
<p>类型:{{item.type}}</p>
|
||||
<p>时间:{{item.time}}</p>
|
||||
<p>处理人:{{item.personName}}</p>
|
||||
</TimelineItem>
|
||||
</Timeline>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user