代码修改

This commit is contained in:
qiuyuan 2025-10-17 19:23:32 +08:00
parent 10a2f3e4c2
commit bb32d532bf
7 changed files with 295 additions and 220 deletions

View File

@ -0,0 +1,22 @@
// 工单模块
import request from '@/utils/request'
// 工单列表-- 全部
export const getWorkOrderList = (params) => request.basic.get('/api/v1/orders', params)
// 异常工单列表
export const getAbnormalWorkOrderList = (params) => request.basic.get('/api/v1/orders/errors_order', params)
// 我下的工单
export const getMyWorkOrderList = (params) => request.basic.get('/api/v1/orders/my_order', params)
// 回访记录
export const getBackRecordList = (params) => request.basic.get('/api/v1/orders/back_order', params)
// 工单回访列表
export const getBackWorkOrderList = (params) => request.basic.get(`/api/v1/orders/noback_order`, params)
// 工单详情
export const getWorkOrderDetail = (id) => request.basic.get(`/api/v1/orders/${id}`)

View File

@ -56,6 +56,7 @@
:columns="columns" :columns="columns"
:data-source="listData" :data-source="listData"
:row-selection="rowSelection" :row-selection="rowSelection"
:scroll="{ x: 'max-content' }"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="'menuType' === column.key"> <template v-if="'menuType' === column.key">
@ -147,6 +148,7 @@ import ViewDialog from './components/viewDialog.vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import storage from '@/utils/storage' import storage from '@/utils/storage'
import AreaCascader from '@/components/AreaCascader/index.vue' import AreaCascader from '@/components/AreaCascader/index.vue'
import dayjs from 'dayjs'
defineOptions({ defineOptions({
// eslint-disable-next-line vue/no-reserved-component-names // eslint-disable-next-line vue/no-reserved-component-names
name: 'menu', name: 'menu',
@ -222,29 +224,44 @@ getMenuList()
* 获取菜单列表 * 获取菜单列表
* @return {Promise<void>} * @return {Promise<void>}
*/ */
async function getMenuList() { async function getMenuList() {
try { try {
showLoading() showLoading()
// const { current } = paginationState const { pageSize, current } = paginationState
const platform = storage.local.getItem('platform')
const { data, success, total } = await apis.menu const { success, data, total } = await apis.workOrder.getAbnormalWorkOrderList({
.getMenuList({ pageSize,
...searchFormData.value, current: current,
platform ...searchFormData.value,
}) })
.catch(() => {
throw new Error() //
}) const mappedData = data.map(item => ({
id: item.orderNum || item.id, // id orderNum
orderId: item.orderNum || '-', //
customerName: item.customerName || '-', //
identityNo: item.customerIdCard || '-', //
serviceUserName: item.serviceName || '-', //
itemNames: item.projects?.map(p => p.name).join('、') || '-', //
realStartTime: item.signInAt, // formatUtcDateTime
realEndTime: item.signOutAt, //
processStatus: item.processStatus === '1' ? '已处理' : item.processStatus === '0' ? '未处理' : '未知', //
processRemark: item.reason || '-', //
processUserName: item.userName || '-', //
processTime: dayjs(item.processAt).format('YYYY-MM-DD HH:mm:ss'), //
serviceAddress: item.detailAddress || '-', //
// 便 id
raw: item,
}))
listData.value = mappedData
paginationState.total = total
hideLoading() hideLoading()
if (config('http.code.success') === success) {
data.forEach((item) => {
item.name = t(item.code) || item.name
})
listData.value = data
paginationState.total = total
}
} catch (error) { } catch (error) {
console.error('获取工单列表失败:', error)
hideLoading() hideLoading()
message.error('获取数据失败')
} }
} }
/** /**

View File

@ -170,25 +170,27 @@ getMenuList()
async function getMenuList() { async function getMenuList() {
try { try {
showLoading() showLoading()
// const { current } = paginationState const { pageSize, current } = paginationState
const platform = storage.local.getItem('platform') const params = {
const { data, success, total } = await apis.menu pageSize,
.getMenuList({ current,
...searchFormData.value, ...searchFormData.value
platform }
})
.catch(() => { params.status = 'Invalid_WorkerOrder'
throw new Error()
}) console.log("=====search params", params)
hideLoading()
const { success, data, total } = await apis.workOrder.getWorkOrderList(params)
if (config('http.code.success') === success) { if (config('http.code.success') === success) {
data.forEach((item) => {
item.name = t(item.code) || item.name
})
listData.value = data listData.value = data
paginationState.total = total paginationState.total = total
} }
} catch (error) { } catch (error) {
console.error('获取工单列表失败:', error)
message.error('获取数据失败')
} finally {
hideLoading() hideLoading()
} }
} }

View File

@ -41,15 +41,15 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-card> <a-card>
<x-action-bar class="mb-8-2"> <!-- <x-action-bar class="mb-8-2">
<a-button v-action="'add'" type="primary" @click="$refs.editDialogRef.handleCreate()"> <a-button v-action="'add'" type="primary" @click="$refs.editDialogRef.handleCreate()">
<template #icon> <template #icon>
<plus-outlined></plus-outlined> <plus-outlined></plus-outlined>
</template> </template>
{{ $t('pages.system.menu.add') }} {{ $t('pages.system.menu.add') }}
</a-button> </a-button>
</x-action-bar> </x-action-bar> -->
<a-table rowKey="id" :loading="loading" :pagination="true" :columns="columns" :data-source="listData"> <a-table rowKey="id" :loading="loading" :pagination="true" :columns="columns" :data-source="listData" :scroll="{ x: 'max-content' }">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="'menuType' === column.key"> <template v-if="'menuType' === column.key">
<!--菜单--> <!--菜单-->
@ -123,21 +123,19 @@ defineOptions({
}) })
const { t } = useI18n() // t const { t } = useI18n() // t
const columns = ref([ const columns = ref([
{ title: '工单号', dataIndex: 'name', key: 'name', fixed: true, width: 280 }, { title: '工单号', dataIndex: 'orderId', key: 'orderId', width: 180 },
{ title: '服务对象', dataIndex: 'code', key: 'code', width: 240 }, { title: '服务对象', dataIndex: 'customerName', key: 'customerName', width: 150 },
{ title: '身份证号', dataIndex: 'type', key: 'menuType', width: 240 }, { title: '身份证号', dataIndex: 'identityNo', key: 'identityNo', width: 300 },
{ title: '联系方式1', dataIndex: 'status', key: 'statusType', width: 240 }, { title: '联系方式1', dataIndex: 'contact1', key: 'contact1', width: 150 },
{ title: '联系方式2', dataIndex: 'sequence', width: 240 }, { title: '联系方式2', dataIndex: 'contact2', key: 'contact2', width: 150 },
{ title: '计划服务时间', dataIndex: 'created_at', key: 'createAt', width: 240 }, { title: '计划服务时常(分钟)', dataIndex: 'workDuration', key: 'workDuration', width: 160 },
{ title: '计划服务时常(分钟)', dataIndex: 'created_at', key: 'createAt', width: 240 }, { title: '服务项目', dataIndex: 'itemNames', key: 'itemNames', width: 200 },
{ title: '服务项目', dataIndex: 'created_at', key: 'createAt', width: 240 }, { title: '所属区域', dataIndex: 'areaLabels', key: 'areaLabels', width: 200, customRender: ({ text }) => text?.join('、') || '-' },
{ title: '所属区域', dataIndex: 'created_at', key: 'createAt', width: 240 }, { title: '服务地址', dataIndex: 'serviceAddress', key: 'serviceAddress', width: 200 },
{ title: '服务地址', dataIndex: 'created_at', key: 'createAt', width: 240 }, { title: '服务人员', dataIndex: 'serviceUserName', key: 'serviceUserName', width: 150 },
{ title: '服务组织', dataIndex: 'created_at', key: 'createAt', width: 240 }, { title: '下单员', dataIndex: 'processUserName', key: 'processUserName', width: 150 },
{ title: '服务人员', dataIndex: 'created_at', key: 'createAt', width: 240 }, { title: '下单时间', dataIndex: 'createAt', key: 'createAt', width: 180, customRender: ({ record }) => formatUtcDateTime(record.raw.createAt) },
{ title: '下单员', dataIndex: 'created_at', key: 'createAt', width: 240 }, ]);
{ title: '下单时间', dataIndex: 'created_at', key: 'createAt', width: 240 },
])
const { listData, loading, showLoading, hideLoading, searchFormData, paginationState, resetPagination } = const { listData, loading, showLoading, hideLoading, searchFormData, paginationState, resetPagination } =
usePagination() usePagination()
const { resetForm } = useForm() const { resetForm } = useForm()
@ -152,26 +150,44 @@ getMenuList()
async function getMenuList() { async function getMenuList() {
try { try {
showLoading() showLoading()
// const { current } = paginationState const { pageSize, current } = paginationState
const platform = storage.local.getItem('platform')
const { data, success, total } = await apis.menu const { success, data, total } = await apis.workOrder.getMyWorkOrderList({
.getMenuList({ pageSize,
...searchFormData.value, current: current,
platform ...searchFormData.value,
}) })
.catch(() => {
throw new Error() //
}) const mappedData = data.map(item => {
// 2 otherPhone1 otherPhone2
const contact2 = item.otherPhone1 || item.otherPhone2 || '-';
return {
id: item.orderNum || item.customerIdCard, //
orderId: item.orderNum || '-',
customerName: item.customerName || '-',
identityNo: item.customerIdCard || '-',
contact1: item.contact1 || '-',
contact2: contact2,
workDuration: item.workDuration ? `${item.workDuration} 分钟` : '-',
itemNames: item.projects?.map(p => p.name).join('、') || '-',
areaLabels: item.areaLabels || [],
serviceAddress: item.detailAddress || '-',
serviceUserName: item.serviceName || '-',
processUserName: item.userName || '-',
createAt: item.createAt, //
raw: item, //
};
});
listData.value = mappedData
paginationState.total = total
hideLoading() hideLoading()
if (config('http.code.success') === success) {
data.forEach((item) => {
item.name = t(item.code) || item.name
})
listData.value = data
paginationState.total = total
}
} catch (error) { } catch (error) {
console.error('获取工单列表失败:', error)
hideLoading() hideLoading()
message.error('获取数据失败')
} }
} }
/** /**

View File

@ -138,7 +138,8 @@
<!-- 表格区域 --> <!-- 表格区域 -->
<a-card style="margin-top: 16px;"> <a-card style="margin-top: 16px;">
<x-action-bar class="mb-8-2"> <x-action-bar class="mb-8-2">
<a-button v-action="'add'" type="primary" @click="$refs.editDialogRef.handleCreate()" style="margin-right: 20px;"> <a-button v-action="'add'" type="primary" @click="$refs.editDialogRef.handleCreate()"
style="margin-right: 20px;">
<template #icon> <template #icon>
<!-- <plus-outlined /> --> <!-- <plus-outlined /> -->
</template> </template>
@ -153,7 +154,8 @@
</a-button> </a-button>
</x-action-bar> </x-action-bar>
<a-table rowKey="id" :loading="loading" :pagination="true" :columns="currentColumns" :data-source="listData"> <a-table rowKey="id" :loading="loading" :pagination="true" :columns="currentColumns" :data-source="listData"
:scroll="{ x: 'max-content' }">
<!-- 表格列渲染逻辑保持不变 --> <!-- 表格列渲染逻辑保持不变 -->
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="'menuType' === column.key"> <template v-if="'menuType' === column.key">
@ -182,14 +184,14 @@
<template v-if="['all', 'initialization', 'pendingCheckin'].includes(activeTabKey)"> <template v-if="['all', 'initialization', 'pendingCheckin'].includes(activeTabKey)">
<x-action-button @click="$refs.cancelDialogRef.showCancelModal(record)"> <x-action-button @click="$refs.cancelDialogRef.showCancelModal(record)">
<a-tooltip><template #title> <a-tooltip><template #title>
{{ '作废' }}</template>作废 {{ '作废' }}</template>作废
</a-tooltip> </a-tooltip>
</x-action-button> </x-action-button>
</template> </template>
<template v-if="['all', 'initialization'].includes(activeTabKey)"> <template v-if="['all', 'initialization'].includes(activeTabKey)">
<x-action-button @click="$refs.editDialogRef.showEditModal(record)"> <x-action-button @click="$refs.editDialogRef.showEditModal(record)">
<a-tooltip><template #title>编辑</template>编辑</a-tooltip> <a-tooltip><template #title>编辑</template>编辑</a-tooltip>
</x-action-button> </x-action-button>
</template> </template>
@ -199,8 +201,8 @@
</x-action-button> </x-action-button>
</template> </template>
<template v-if="['all','expiredUncheckedIn', 'expiredUncheckedOut'].includes(activeTabKey)"> <template v-if="['all', 'expiredUncheckedIn', 'expiredUncheckedOut'].includes(activeTabKey)">
<x-action-button @click="$refs.checkDialogRef.showCheckModal(record)" > <x-action-button @click="$refs.checkDialogRef.showCheckModal(record)">
<a-tooltip><template #title>待签入</template>待签入</a-tooltip> <a-tooltip><template #title>待签入</template>待签入</a-tooltip>
</x-action-button> </x-action-button>
</template> </template>
@ -246,6 +248,7 @@ import CheckDialog from './components/CheckDialog.vue'
import { useI18n } from 'vue-i18n' import { useI18n } from 'vue-i18n'
import storage from '@/utils/storage' import storage from '@/utils/storage'
import AreaCascader from '@/components/AreaCascader/index.vue' import AreaCascader from '@/components/AreaCascader/index.vue'
import dayjs from 'dayjs'
defineOptions({ defineOptions({
name: 'menu', name: 'menu',
@ -262,14 +265,68 @@ const cancelReason = ref('')
// //
const columnConfigs = ref({ const columnConfigs = ref({
all: [ all: [
{ title: '工单号', dataIndex: 'name', key: 'name', fixed: true, width: 280 },
{ title: '服务对象', dataIndex: 'code', key: 'code', width: 240 }, // { title: '', dataIndex: 'orderNum', key: 'orderNum', fixed: true, width: 280 },
{ title: '身份证号', dataIndex: 'idCard', key: 'idCard', width: 240 }, { title: '服务对象', dataIndex: 'customerName', key: 'customerName', width: 140 },
{ title: '联系方式1', dataIndex: 'phone1', key: 'phone1', width: 240 }, { title: '服务对象身份证', dataIndex: 'customerIdCard', key: 'customerIdCard', width: 240 },
{ title: '联系方式2', dataIndex: 'phone2', key: 'phone2', width: 240 }, {
{ title: '计划服务时间', dataIndex: 'scheduledTime', key: 'scheduledTime', width: 240 }, title: '服务对象分类', dataIndex: 'labels', key: 'labels', width: 140,
{ title: '服务状态', dataIndex: 'status', key: 'statusType', width: 180 }, render: (labels) => Array.isArray(labels) ? labels.join(', ') : ''
},
{ title: '服务人员', dataIndex: 'serviceName', key: 'serviceName', width: 140 },
{
title: '计划日期',
dataIndex: 'plannedStartDate',
key: 'plannedStartDate',
width: 240,
customRender: ({ text, record }) => {
if (!text) return '';
try {
// dayjs
const formatted = dayjs(text).format('YYYY-MM-DD HH:mm:ss');
return formatted;
} catch (e) {
console.error('日期格式化失败:', text, e);
return text; // return ''
}
}
},
{
title: '服务项目分类',
// projects[0].categoryType
render: (_, record) => record.projects?.[0]?.categoryType || record.projects?.[0]?.categoryMethod || '',
key: 'serviceCategory',
width: 240
},
{
title: '服务项目',
render: (_, record) => record.projects?.[0]?.name || '',
key: 'serviceNameProject',
width: 240
},
{
title: '服务费用',
render: (_, record) => record.projects?.[0]?.price ?? 0,
key: 'servicePrice',
width: 140
},
{
title: '实际支付费用',
// actualPaid
render: (_, record) => record.projects?.[0]?.price ?? 0,
key: 'actualPaid',
width: 140
},
{
title: '计划服务时间(分钟)',
dataIndex: 'workDuration',
key: 'workDuration',
width: 240
},
{ title: '服务状态', dataIndex: 'status', key: 'status', width: 180 },
{ title: '操作', key: 'action', width: 440, fixed: 'right' } { title: '操作', key: 'action', width: 440, fixed: 'right' }
], ],
initialization: [ initialization: [
{ title: '工单号', dataIndex: 'name', key: 'name', fixed: true, width: 280 }, { title: '工单号', dataIndex: 'name', key: 'name', fixed: true, width: 280 },
@ -334,6 +391,15 @@ const viewDialogRef = ref()
const checkDialogRef = ref() const checkDialogRef = ref()
// //
const advancedSearchVisible = ref([]) // const advancedSearchVisible = ref([]) //
const tabKeyToStatusMap = {
all: undefined, // status
initialization: 'Initialize',
pendingCheckin: 'Pending_Check-in',
completed: 'Closed',
cancelled: 'Cancelled',
expiredUncheckedIn: 'Overdue_Unchecked-in',
expiredUncheckedOut: 'Overdue_Unchecked-out'
}
// //
getMenuList() getMenuList()
@ -345,25 +411,34 @@ getMenuList()
async function getMenuList() { async function getMenuList() {
try { try {
showLoading() showLoading()
const platform = storage.local.getItem('platform') const { pageSize, current } = paginationState
const { data, success, total } = await apis.menu
.getMenuList({ // tab status
...searchFormData.value, const status = tabKeyToStatusMap[activeTabKey.value]
status: activeTabKey.value, // key
platform const params = {
}) pageSize,
.catch(() => { current,
throw new Error() ...searchFormData.value
}) }
hideLoading()
// status undefined
if (status !== undefined) {
params.status = status
}
console.log("=====search params", params)
const { success, data, total } = await apis.workOrder.getWorkOrderList(params)
if (config('http.code.success') === success) { if (config('http.code.success') === success) {
data.forEach((item) => {
item.name = t(item.code) || item.name
})
listData.value = data listData.value = data
paginationState.total = total paginationState.total = total
} }
} catch (error) { } catch (error) {
console.error('获取工单列表失败:', error)
message.error('获取数据失败')
} finally {
hideLoading() hideLoading()
} }
} }
@ -371,7 +446,18 @@ async function getMenuList() {
/** /**
* 标签页切换事件 * 标签页切换事件
*/ */
function handleTabChange(key) { function handleTabChange(key) {
//
// Initialize
// Pending_Check-in
// Pending_Check-out
// Closed
// Cancelled
// Overdue_Unchecked-in
// Overdue_Unchecked-out
console.log('active tab key:', key)
activeTabKey.value = key activeTabKey.value = key
resetPagination() resetPagination()
getMenuList() // getMenuList() //
@ -479,7 +565,7 @@ function onAreaChange(value) {
// //
function toggleAdvancedSearch() { function toggleAdvancedSearch() {
advancedSearchVisible.value = advancedSearchVisible.value.length ? [] : ['1'] advancedSearchVisible.value = advancedSearchVisible.value.length ? [] : ['1']
} }
</script> </script>
@ -493,10 +579,7 @@ function toggleAdvancedSearch() {
// style // style
.ant-btn-link:hover { .ant-btn-link:hover {
color: #0050b3; color: #0050b3;
text-decoration: underline; text-decoration: underline;
} }
</style> </style>

View File

@ -218,77 +218,22 @@ const detailRef = ref()
// //
const advancedSearchVisible = ref([]) // const advancedSearchVisible = ref([]) //
const treeData = ref([
{
title: 'Node1',
value: '0-0',
key: '0-0',
children: [
{
value: '0-0-1',
key: '0-0-1',
slots: {
title: 'title',
},
},
{
title: 'Child Node2',
value: '0-0-2',
key: '0-0-2',
},
],
},
{
title: 'Node2',
value: '0-1',
key: '0-1',
},
]);
const options = ref([
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake',
},
],
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
},
],
},
],
},])
getPageList() getPageList()
async function getPageList() { async function getPageList() {
console.log("===1")
try { try {
const { pageSize, current } = paginationState const { pageSize, current } = paginationState
const { success, data, total } = await apis.serviceStaffList const { success, data, total } = await apis.workOrder
.getProjectList({ .getBackRecordList({
pageSize, pageSize,
current: current, current: current,
...searchFormData.value, ...searchFormData.value,
}) })
listData.value = data
paginationState.total = total
console.log("===",data)
.catch(() => { .catch(() => {
throw new Error() throw new Error()
}) })

View File

@ -124,9 +124,9 @@
</template> </template>
</x-search-bar> </x-search-bar>
<a-row :gutter="8" :wrap="false"> <a-row :gutter="8" :wrap="false" style="margin-top: 20px;">
<a-col flex="auto"> <a-col flex="auto">
<a-card title="服务人员列表"> <a-card title="回访列表">
<div style="margin-bottom: 20px;"> <div style="margin-bottom: 20px;">
<a-space> <a-space>
<a-button type="primary">导入</a-button> <a-button type="primary">导入</a-button>
@ -135,14 +135,23 @@
<a-button type="primary">导出记录</a-button> <a-button type="primary">导出记录</a-button>
</a-space> </a-space>
</div> </div>
<a-table :columns="columns" :data-source="listData" bordered :loading="loading" <a-table rowKey="id" :loading="loading" :pagination="true" :columns="columns" :data-source="listData"
:pagination="paginationState" :scroll="{ x: 'max-content' }" @change="onTableChange"> :scroll="{ x: 'max-content' }">
<template #bodyCell="{ index, column }">
<template #bodyCell="{ column, record, index }">
<template v-if="column.key === 'serialNumber'"> <template v-if="column.key === 'serialNumber'">
<span>{{ index + 1 }}</span> <span>{{ index + 1 }}</span>
</template> </template>
<template v-if="'action' === column.key"> <template v-else-if="column.dataIndex === 'otherPhone1'">
<span>{{ record.otherPhone1 || record.otherPhone2 || '—' }}</span>
</template>
<template v-else-if="column.dataIndex === 'plannedServiceStartDate'">
<span>{{ formatDate(record.plannedServiceStartDate) }}</span>
</template>
<template v-else-if="column.key === 'action'">
<x-action-button @click="$refs.editDialogRef.handleView(record)"> <x-action-button @click="$refs.editDialogRef.handleView(record)">
<span>详情</span> <span>详情</span>
</x-action-button> </x-action-button>
@ -150,8 +159,6 @@
回访 回访
</x-action-button> </x-action-button>
</template> </template>
</template> </template>
</a-table> </a-table>
</a-card> </a-card>
@ -176,6 +183,7 @@ import { useDicsStore } from '@/store'
import EditDialog from './components/EditDialog.vue' import EditDialog from './components/EditDialog.vue'
// 访 // 访
import VisitDialog from './components/VisitDialog.vue' import VisitDialog from './components/VisitDialog.vue'
import dayjs from 'dayjs'
defineOptions({ defineOptions({
name: 'allocation', name: 'allocation',
@ -186,18 +194,19 @@ const { t } = useI18n()
// //
const columns = [ const columns = [
{ title: '序号', dataIndex: 'serialNumber', key: 'serialNumber', align: 'center', width: 80 }, { title: '订单号', dataIndex: 'orderNum', key: 'orderNum', align: 'center', width: 80 },
{ title: '姓名', dataIndex: 'name', key: 'name', align: 'center', width: 100 }, { title: '服务对象姓名', dataIndex: 'customerName', key: 'customerName', align: 'center', width: 100 },
{ title: '性别', dataIndex: 'gender', key: 'gender', align: 'center', width: 80 }, { title: '电话', dataIndex: 'contact1', key: 'contact1', align: 'center', width: 120 },
{ title: '电话', dataIndex: 'phone', key: 'phone', align: 'center', width: 120 }, { title: '电话1', dataIndex: 'otherPhone1', key: 'otherPhone1', align: 'center', width: 120 },
{ title: '身份证号', dataIndex: 'idCard', key: 'idCard', align: 'center', width: 180 }, { title: '电话2', dataIndex: 'otherPhone2', key: 'otherPhone2', align: 'center', width: 120 },
{ title: '护理人员类型', dataIndex: 'serviceType', key: 'serviceType', align: 'center', width: 120 }, { title: '身份证号', dataIndex: 'customerIdCard', key: 'customerIdCard', align: 'center', width: 240 },
{ title: '用工形式', dataIndex: 'workType', key: 'workType', align: 'center', width: 120 }, { title: '地址', dataIndex: 'detailAddress', key: 'detailAddress', align: 'center', width: 240 },
{ title: '状态', dataIndex: 'status', key: 'status', align: 'center', width: 100 }, { title: '服务人员姓名', dataIndex: 'serviceName', key: 'serviceName', align: 'center', width: 120 },
{ title: '所属服务组织', dataIndex: 'stationName', key: 'stationName', align: 'center', width: 150 }, { title: '服务项目名称', dataIndex: 'workType', key: 'workType', align: 'center', width: 120 },
{ title: '操作', key: 'action', width: 240, fixed: 'right', align: 'center' } { title: '计划服务开始时间', dataIndex: 'plannedServiceStartDate', key: 'plannedServiceStartDate', align: 'center', width: 100 },
{ title: '状态', dataIndex: 'status', key: 'status', align: 'center', width: 150 },
{ title: '操作', key: 'action', width: 140, fixed: 'right' }
] ]
// //
const { const {
listData, listData,
@ -227,44 +236,25 @@ const detailRef = ref()
const advancedSearchVisible = ref([]) // const advancedSearchVisible = ref([]) //
// 访 // 访
const visitDialogRef = ref() const visitDialogRef = ref()
//
const totalWidth = columns.reduce((sum, col) => sum + (col.width || 100), 0);
// mock // mock
async function getPageList() { async function getPageList() {
loading.value = true loading.value = true
try { try {
// ========== mock ========== const { pageSize, current } = paginationState
const mockData = [ const params = {
{ pageSize,
serialNumber: 1, current,
name: '张三', ...searchFormData.value,
gender: '男', }
phone: '13800138000', if (Array.isArray(params.plannedDate) && params.plannedDate.length === 0) {
idCard: '110101199003077890', delete params.plannedDate
serviceType: '全职护理员', }
workType: '劳动合同', const { success, data, total } = await apis.workOrder.getBackWorkOrderList(params)
status: '在职', listData.value = data
stationName: '朝阳区居家养老服务中心', paginationState.total = total
}
]
listData.value = mockData
paginationState.total = 1
// ==================================
// ====== ======
// const { pageSize, current } = paginationState
// const params = {
// pageSize,
// current,
// ...searchFormData.value,
// }
// if (Array.isArray(params.plannedDate) && params.plannedDate.length === 0) {
// delete params.plannedDate
// }
// const { success, data, total } = await apis.serviceStaffList.getProjectList(params)
// if (config('http.code.success') === success) {
// listData.value = data
// paginationState.total = total
// }
} catch (error) { } catch (error) {
console.error('获取列表失败:', error) console.error('获取列表失败:', error)
message.error('加载数据失败') message.error('加载数据失败')
@ -326,14 +316,14 @@ function handleDetail(record) {
// 访访 // 访访
function handleVisit(record) { function handleVisit(record) {
visitDialogRef.value.handleOpen(record) // 访 visitDialogRef.value.handleOpen(record) // 访
} }
// 访 // 访
function onVisitOk(formData) { function onVisitOk(formData) {
console.log('回访表单数据:', formData) console.log('回访表单数据:', formData)
message.success('回访提交成功') message.success('回访提交成功')
getPageList() // getPageList() //
} }
// //