异常工单修改

This commit is contained in:
qiuyuan 2025-11-10 14:00:07 +08:00
parent 65ea48af37
commit 729403c391
2 changed files with 403 additions and 195 deletions

View File

@ -7,6 +7,27 @@
@cancel="handleCancel" @cancel="handleCancel"
wrapClassName="order-detail-modal" wrapClassName="order-detail-modal"
> >
<!-- 用户信息 -->
<a-descriptions bordered size="small" :column="2" class="mb-6">
<template #title>
<a-divider orientation="left">用户信息</a-divider>
</template>
<a-descriptions-item label="工单号">{{ detail.workOrderNo || '-' }}</a-descriptions-item>
<a-descriptions-item label="工单状态">{{ detail.status || '-' }}</a-descriptions-item>
<a-descriptions-item label="工单类型">{{ detail.type || '-' }}</a-descriptions-item>
<a-descriptions-item label="姓名">{{ detail.userName || '-' }}</a-descriptions-item>
<a-descriptions-item label="性别">{{ detail.gender || '-' }}</a-descriptions-item>
<a-descriptions-item label="年龄">{{ detail.age ? detail.age + ' 岁' : '-' }}</a-descriptions-item>
<a-descriptions-item label="联系电话">{{ detail.phone || '-' }}</a-descriptions-item>
<a-descriptions-item label="身份证号">{{ detail.idCard || '-' }}</a-descriptions-item>
<a-descriptions-item label="评估等级" :span="2">
{{ detail.assessmentLevel || '未填写' }}
</a-descriptions-item>
</a-descriptions>
<!-- 服务轨迹 --> <!-- 服务轨迹 -->
<a-descriptions bordered size="small" :column="2" class="mb-6"> <a-descriptions bordered size="small" :column="2" class="mb-6">
<template #title> <template #title>
@ -14,14 +35,14 @@
</template> </template>
<a-descriptions-item label="签入时间"> <a-descriptions-item label="签入时间">
{{ detail.checkInTime }} {{ detail.checkInTime || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签入距离"> <a-descriptions-item label="签入距离">
{{ detail.checkInDistance }} {{ detail.checkInDistance || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签入地址" :span="2"> <a-descriptions-item label="签入地址" :span="2">
{{ detail.checkInAddress }} {{ detail.checkInAddress || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签入图片" :span="2"> <a-descriptions-item label="签入图片" :span="2">
@ -43,14 +64,14 @@
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签出时间"> <a-descriptions-item label="签出时间">
{{ detail.checkOutTime }} {{ detail.checkOutTime || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签出距离"> <a-descriptions-item label="签出距离">
{{ detail.checkOutDistance }} {{ detail.checkOutDistance || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签出地址" :span="2"> <a-descriptions-item label="签出地址" :span="2">
{{ detail.checkOutAddress }} {{ detail.checkOutAddress || '-' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="签出图片" :span="2"> <a-descriptions-item label="签出图片" :span="2">
@ -76,36 +97,33 @@
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="实际服务时长" :span="2"> <a-descriptions-item label="实际服务时长" :span="2">
{{ detail.serviceDuration }} {{ detail.serviceDuration || '-' }}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<!-- 用户信息 -->
<a-descriptions bordered size="small" :column="2" class="mb-6">
<template #title>
<a-divider orientation="left">用户信息</a-divider>
</template>
<a-descriptions-item label="工单号">{{ detail.orderNo }}</a-descriptions-item>
<a-descriptions-item label="姓名">{{ detail.userName }}</a-descriptions-item>
<a-descriptions-item label="性别">{{ detail.gender }}</a-descriptions-item>
<a-descriptions-item label="年龄">{{ detail.age }} </a-descriptions-item>
<a-descriptions-item label="联系电话">{{ detail.phone }}</a-descriptions-item>
<a-descriptions-item label="身份证号">{{ detail.idCard }}</a-descriptions-item>
<a-descriptions-item label="评估等级" :span="2">
{{ detail.assessmentLevel || '未填写' }}
</a-descriptions-item>
</a-descriptions>
<!-- 任务信息 --> <!-- 任务信息 -->
<a-descriptions bordered size="small" :column="2" class="mb-6"> <a-descriptions bordered size="small" :column="2" class="mb-6">
<template #title> <template #title>
<a-divider orientation="left">任务信息</a-divider> <a-divider orientation="left">任务信息</a-divider>
</template> </template>
<a-descriptions-item label="护理员">{{ detail.caregiver }}</a-descriptions-item> <a-descriptions-item label="护理员">{{ detail.nurseName || '-' }}</a-descriptions-item>
<a-descriptions-item label="护理等级">{{ detail.careLevel || '未填写' }}</a-descriptions-item> <a-descriptions-item label="护理等级">{{ detail.nurseLevel || '未填写' }}</a-descriptions-item>
<a-descriptions-item label="计划服务时间">{{ detail.plannedTime }}</a-descriptions-item> <a-descriptions-item label="计划开始日期">
{{ detail.planStartDate ? dayjs(detail.planStartDate).format('YYYY-MM-DD') : '-' }}
</a-descriptions-item>
<a-descriptions-item label="计划结束日期">
{{ detail.planEndDate ? dayjs(detail.planEndDate).format('YYYY-MM-DD') : '-' }}
</a-descriptions-item>
<a-descriptions-item label="计划服务开始时间">
{{ detail.planStartTime ? dayjs(detail.planStartTime).format('HH:mm') : '-' }}
</a-descriptions-item>
<a-descriptions-item label="下单人">{{ detail.orderer || '-' }}</a-descriptions-item>
<a-descriptions-item label="下单时间">
{{ detail.orderTime ? dayjs(detail.orderTime).format('YYYY-MM-DD HH:mm:ss') : '-' }}
</a-descriptions-item>
<a-descriptions-item label="服务地址" :span="2"> <a-descriptions-item label="服务地址" :span="2">
{{ detail.serviceAddress }} {{ detail.serviceAddress || '-' }}
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
@ -122,62 +140,161 @@
/> />
</div> </div>
<!-- 服务内容 -->
<a-descriptions bordered size="small" :column="1" class="mb-6">
<template #title>
<a-divider orientation="left">服务内容</a-divider>
</template>
<a-descriptions-item label="服务内容">
{{ detail.serviceContent || '无' }}
</a-descriptions-item>
</a-descriptions>
<!-- 服务小结与反馈 -->
<a-descriptions bordered size="small" :column="1" class="mb-6">
<template #title>
<a-divider orientation="left">服务小结与反馈</a-divider>
</template>
<a-descriptions-item label="服务小结">
{{ detail.summary || '无' }}
</a-descriptions-item>
<a-descriptions-item label="用户需求反馈">
{{ detail.feedback || '无' }}
</a-descriptions-item>
</a-descriptions>
<!-- 服务评价 -->
<a-descriptions bordered size="small" :column="2" class="mb-6">
<template #title>
<a-divider orientation="left">服务评价</a-divider>
</template>
<a-descriptions-item label="服务满意度">
{{ detail.serviceSatisfaction || '-' }}
</a-descriptions-item>
<a-descriptions-item label="评价渠道">
{{ detail.evaluationChannel || '-' }}
</a-descriptions-item>
<a-descriptions-item label="评价内容" :span="2">
{{ detail.evaluationContent || '无' }}
</a-descriptions-item>
<a-descriptions-item label="评价人">
{{ detail.evaluator || '-' }}
</a-descriptions-item>
<a-descriptions-item label="评价时间">
{{ detail.evaluationTime ? dayjs(detail.evaluationTime).format('YYYY-MM-DD HH:mm:ss') : '-' }}
</a-descriptions-item>
</a-descriptions>
<!-- 回访评价 -->
<a-descriptions bordered size="small" :column="2" class="mb-6">
<template #title>
<a-divider orientation="left">回访评价</a-divider>
</template>
<a-descriptions-item label="服务满意度">
{{ detail.visitSatisfaction || '-' }}
</a-descriptions-item>
<a-descriptions-item label="服务人员满意度">
{{ detail.staffSatisfaction || '-' }}
</a-descriptions-item>
<a-descriptions-item label="服务反馈" :span="2">
{{ detail.visitFeedback || '无' }}
</a-descriptions-item>
<a-descriptions-item label="回访人">
{{ detail.visitor || '-' }}
</a-descriptions-item>
<a-descriptions-item label="回访时间">
{{ detail.visitTime ? dayjs(detail.visitTime).format('YYYY-MM-DD HH:mm:ss') : '-' }}
</a-descriptions-item>
</a-descriptions>
<!-- 异常工单处理信息 --> <!-- 异常工单处理信息 -->
<a-descriptions bordered size="small" :column="2"> <a-descriptions bordered size="small" :column="2">
<template #title> <template #title>
<a-divider orientation="left">异常工单处理信息</a-divider> <a-divider orientation="left">异常工单处理信息</a-divider>
</template> </template>
<a-descriptions-item label="处理状态">{{ detail.exceptionStatus }}</a-descriptions-item> <a-descriptions-item label="处理状态">{{ detail.exceptionStatus || '无' }}</a-descriptions-item>
<a-descriptions-item label="处理原因">{{ detail.exceptionReason || '无' }}</a-descriptions-item> <a-descriptions-item label="处理原因">{{ detail.exceptionReason || '无' }}</a-descriptions-item>
<a-descriptions-item label="处理人">{{ detail.exceptionHandler || '无' }}</a-descriptions-item> <a-descriptions-item label="处理人">{{ detail.exceptionHandler || '无' }}</a-descriptions-item>
<a-descriptions-item label="处理时间">{{ detail.exceptionTime || '无' }}</a-descriptions-item> <a-descriptions-item label="处理时间">
{{ detail.exceptionTime ? dayjs(detail.exceptionTime).format('YYYY-MM-DD HH:mm:ss') : '无' }}
</a-descriptions-item>
</a-descriptions> </a-descriptions>
</a-modal> </a-modal>
</template> </template>
<script setup> <script setup>
import { reactive } from 'vue' import { ref, reactive } from 'vue'
import { message } from 'ant-design-vue'
import { useModal } from '@/hooks' import { useModal } from '@/hooks'
import apis from '@/apis'
import dayjs from 'dayjs'
import { useDicsStore } from '@/store'
const dicsStore = useDicsStore()
const { modal, hideModal } = useModal() const { modal, hideModal } = useModal()
// //
const detail = reactive({ const detail = reactive({
checkInTime: '2025-10-15 11:44:01', //
checkInDistance: '14996 m', checkInTime: '',
checkInAddress: '江苏省南通市通州区十总镇南通市通州区十总镇五总居8-128西北775米', checkInDistance: '',
checkInImages: [ checkInAddress: '',
'https://akt.obs.cn-east-3.myhuaweicloud.com:443/hahacloud/saas/1813150290048446464/6a4ddb23-8733-4ca4-a1f9-b0f061a4ca0a.jpg?AccessKeyId=EBJWO1KETPFJKBWNCG5V&Expires=1761122523&Signature=bygou7kYVrQ6f9bDDWlpebs15Nc%3D', checkInImages: [],
'https://akt.obs.cn-east-3.myhuaweicloud.com:443/hahacloud/saas/1813150290048446464/11ce319c-705e-431a-a3a7-4a9bb8350fce.jpg?AccessKeyId=EBJWO1KETPFJKBWNCG5V&Expires=1761122523&Signature=cOHYxAxsTP0RQDgT2bNv2jjkWco%3D' checkOutTime: '',
], checkOutDistance: '',
checkOutTime: '2025-10-15 12:44:43', checkOutAddress: '',
checkOutDistance: '14984 m', checkOutImages: [],
checkOutAddress: '江苏省南通市通州区十总镇南通市通州区十总镇五总居8-128西北757米', checkOutRemark: '',
checkOutImages: [ serviceDuration: '',
'https://akt.obs.cn-east-3.myhuaweicloud.com:443/hahacloud/saas/1813150290048446464/3e7817e4-4d31-41d8-ba89-6532a5baea5d.jpg?AccessKeyId=EBJWO1KETPFJKBWNCG5V&Expires=1761122523&Signature=efu9s%2BjgIXdxZPU6sEH5OR0ipdE%3D',
'https://akt.obs.cn-east-3.myhuaweicloud.com:443/hahacloud/saas/1813150290048446464/9902435e-fd61-423c-9681-7f11bcab7ee8.jpg?AccessKeyId=EBJWO1KETPFJKBWNCG5V&Expires=1761122523&Signature=y204ac9D%2BiI%2BWtNOaOu9UylAezg%3D', //
'https://akt.obs.cn-east-3.myhuaweicloud.com:443/hahacloud/saas/1813150290048446464/157a72f1-c081-4407-ab48-e38e25b38a24.jpg?AccessKeyId=EBJWO1KETPFJKBWNCG5V&Expires=1761122523&Signature=wvjINjdpPlG3QhkuDYIAISc20sY%3D' workOrderNo: '',
], status: '',
checkOutRemark: '助洁理发,助餐剥花生', type: '',
serviceDuration: '60 分钟', userName: '',
orderNo: '202510151043270345563994', gender: '',
userName: '顾美田', age: null,
gender: '男', phone: '',
age: '90', idCard: '',
phone: '18452439097',
idCard: '320624193507244576',
assessmentLevel: '', assessmentLevel: '',
caregiver: '于圣霞',
careLevel: '', //
plannedTime: '2025-10-15 10:42:00', nurseName: '',
serviceAddress: '江苏省南通市通州区十总镇五总社区居委会通州区五总居十七组3号', nurseLevel: '',
serviceItems: [ planStartDate: null,
{ itemCategoryName: '助乐服务', itemName: '精神关爱', careDuration: '60' } planEndDate: null,
], planStartTime: null,
exceptionStatus: '未处理', serviceAddress: '',
orderer: '',
orderTime: null,
//
serviceItems: [],
serviceContent: '',
//
summary: '',
feedback: '',
//
serviceSatisfaction: '',
evaluationChannel: '',
evaluationContent: '',
evaluator: '',
evaluationTime: null,
// 访
visitSatisfaction: '',
staffSatisfaction: '',
visitFeedback: '',
visitor: '',
visitTime: null,
//
exceptionStatus: '',
exceptionReason: '', exceptionReason: '',
exceptionHandler: '', exceptionHandler: '',
exceptionTime: '' exceptionTime: null
}) })
const serviceColumns = [ const serviceColumns = [
@ -186,15 +303,133 @@ const serviceColumns = [
{ title: '服务时长(分钟)', dataIndex: 'careDuration', width: '30%' } { title: '服务时长(分钟)', dataIndex: 'careDuration', width: '30%' }
] ]
/**
* 查看工单唯一打开弹框的方法
* @param {Object} record - 工单数据
*/
function handleView(record = {}) {
modal.value.open = true
modal.value.title = '查看工单'
console.log('查看工单数据:', record)
loadWorkOrderDetail(record.id)
}
/**
* 加载工单详情并填充表单
* @param {string} id - 工单ID
*/
async function loadWorkOrderDetail(id) {
console.log('开始加载工单详情ID:', id)
try {
const { success, data } = await apis.workOrder.getWorkOrderDetail(id)
console.log('工单详情接口响应:', data)
if (success && data) {
const detailData = data
console.log('工单详情数据:', detailData)
//
let serviceItems = detailData.projects?.map(item => ({
itemCategoryName: item.category || '未分类',
itemName: item.name || '',
careDuration: item.duration || '0'
})) || []
//
let areaLabels = detailData.areaLabels || []
let serviceAddress = areaLabels.join('') + (detailData.detailAddress || '')
// -
let age = null
if (detailData.customer?.birthday) {
const birthYear = new Date(detailData.customer.birthday).getFullYear()
const currentYear = new Date().getFullYear()
age = currentYear - birthYear
}
//
Object.assign(detail, {
//
checkInTime: detailData.checkInTime || '',
checkInDistance: detailData.checkInDistance || '',
checkInAddress: detailData.checkInAddress || '',
checkInImages: detailData.checkInImages || [],
checkOutTime: detailData.checkOutTime || '',
checkOutDistance: detailData.checkOutDistance || '',
checkOutAddress: detailData.checkOutAddress || '',
checkOutImages: detailData.checkOutImages || [],
checkOutRemark: detailData.checkOutRemark || '',
serviceDuration: detailData.serviceDuration || '',
//
workOrderNo: detailData.orderNum || '',
status: dicsStore.getDictLabel('Work_Order_Status', detailData.status) || '',
type: dicsStore.getDictLabel('ORDER_TYPE', detailData.orderType) || '',
userName: detailData.customer?.name || '',
gender: detailData.customer?.gender || '',
age: age,
phone: detailData.customer?.contact1 || '',
idCard: detailData.customer?.identityNo || '',
assessmentLevel: detailData.assessmentLevel || '',
//
nurseName: detailData.servicePerson?.name || '',
nurseLevel: detailData.serviceContent?.gender || '', //
planStartDate: detailData.plannedStartDate || null,
planEndDate: detailData.plannedEndDate || null,
planStartTime: detailData.plannedServiceStartDate || null,
serviceAddress: serviceAddress,
orderer: detailData.createdBy?.name || '',
orderTime: detailData.createdAt || null,
//
serviceItems: serviceItems,
serviceContent: detailData.projects?.map(item => item.name).join(', ') || '',
//
summary: detailData.serviceSummary || '',
feedback: detailData.userDemandFeedback || '',
//
serviceSatisfaction: detailData.serviceSatisfaction || '',
evaluationChannel: detailData.evaluationChannel || '',
evaluationContent: detailData.evaluationContent || '',
evaluator: detailData.evaluator || '',
evaluationTime: detailData.evaluationTime || null,
// 访
visitSatisfaction: detailData.visitSatisfaction || '',
staffSatisfaction: detailData.staffSatisfaction || '',
visitFeedback: detailData.visitFeedback || '',
visitor: detailData.visitor || '',
visitTime: detailData.visitTime || null,
//
exceptionStatus: detailData.orderError?.status || '',
exceptionReason: detailData.orderError?.reason || '',
exceptionHandler: detailData.orderError?.user?.name || '',
exceptionTime: detailData.orderError?.updated_at || null
})
console.log('设置后的详情数据:', detail)
} else {
message.error('获取工单详情失败')
}
} catch (error) {
console.error('获取工单详情失败:', error)
message.error('加载工单信息失败')
}
}
/**
* 取消/关闭按钮
*/
function handleCancel() { function handleCancel() {
hideModal() hideModal()
} }
function handleView() { //
modal.value.open = true
modal.value.title = '工单详情'
}
defineExpose({ defineExpose({
handleView handleView
}) })

View File

@ -109,14 +109,14 @@
v-model:open="processModalVisible" v-model:open="processModalVisible"
title="处理异常" title="处理异常"
@ok="handleProcessSubmit" @ok="handleProcessSubmit"
@cancel="processModalVisible = false" @cancel="handleProcessCancel"
:confirm-loading="processSubmitting" :confirm-loading="processSubmitting"
> >
<a-form :model="processForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }"> <a-form :model="processForm" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
<a-form-item label="处理结果" name="processStatus" required> <a-form-item label="处理结果" name="processStatus" required>
<a-select v-model:value="processForm.processStatus" placeholder="请选择处理结果"> <a-select v-model:value="processForm.processStatus" placeholder="请选择处理结果">
<a-select-option value="handled">已处理</a-select-option> <a-select-option value="Success">处理成功</a-select-option>
<a-select-option value="ignored">忽略</a-select-option> <a-select-option value="Fail">处理失败</a-select-option>
<!-- 可根据实际枚举扩展 --> <!-- 可根据实际枚举扩展 -->
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -137,7 +137,7 @@
<script setup> <script setup>
import { Modal, message } from 'ant-design-vue' import { Modal, message } from 'ant-design-vue'
import { ref,reactive } from 'vue' import { ref, reactive } from 'vue'
import { PlusOutlined, EditOutlined, DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons-vue' import { PlusOutlined, EditOutlined, DeleteOutlined, PlusCircleOutlined } from '@ant-design/icons-vue'
import apis from '@/apis' import apis from '@/apis'
import { config } from '@/config' import { config } from '@/config'
@ -149,11 +149,13 @@ 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' 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',
}) })
const { t } = useI18n() // t
const { t } = useI18n()
const columns = ref([ const columns = ref([
{ title: '工单号', dataIndex: 'orderId', key: 'orderId', width: 180 }, { title: '工单号', dataIndex: 'orderId', key: 'orderId', width: 180 },
{ title: '姓名', dataIndex: 'customerName', key: 'customerName', width: 120 }, { title: '姓名', dataIndex: 'customerName', key: 'customerName', width: 120 },
@ -170,17 +172,17 @@ const columns = ref([
{ title: '服务地址', dataIndex: 'serviceAddress', key: 'serviceAddress', width: 200 }, { title: '服务地址', dataIndex: 'serviceAddress', key: 'serviceAddress', width: 200 },
{ title: '操作', key: 'action', fixed: 'right', width: 340 }, { title: '操作', key: 'action', fixed: 'right', width: 340 },
]) ])
const { listData, loading, showLoading, hideLoading, searchFormData, paginationState, resetPagination } =
usePagination() const { listData, loading, showLoading, hideLoading, searchFormData, paginationState, resetPagination } = usePagination()
const { resetForm } = useForm() const { resetForm } = useForm()
const viewDialogRef = ref() const viewDialogRef = ref()
const selectedRowKeys = ref([]) // id const selectedRowKeys = ref([])
const selectedRows = ref([]) // const selectedRows = ref([])
const rowSelection = ref({ const rowSelection = ref({
onChange: (keys, rows) => { onChange: (keys, rows) => {
if (keys.length > 40) { if (keys.length > 40) {
message.warning('最多只能选择40条记录进行批量处理') message.warning('最多只能选择40条记录进行批量处理')
// 40
selectedRowKeys.value = keys.slice(0, 40) selectedRowKeys.value = keys.slice(0, 40)
selectedRows.value = rows.slice(0, 40) selectedRows.value = rows.slice(0, 40)
return return
@ -191,9 +193,7 @@ const rowSelection = ref({
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
}) })
//
//
const processModalVisible = ref(false) const processModalVisible = ref(false)
const processSubmitting = ref(false) const processSubmitting = ref(false)
const processForm = reactive({ const processForm = reactive({
@ -201,8 +201,7 @@ const processForm = reactive({
processRemark: '', processRemark: '',
}) })
let currentProcessRecords = [] //
let currentProcessRecords = [] //
// //
function handleBatchProcess() { function handleBatchProcess() {
@ -217,63 +216,116 @@ function handleBatchProcess() {
processModalVisible.value = true processModalVisible.value = true
} }
getMenuList() //
function handleSingleProcess(record) {
currentProcessRecords = [record]
processForm.processStatus = undefined
processForm.processRemark = ''
processModalVisible.value = true
}
//
function handleProcessCancel() {
processModalVisible.value = false
processForm.processStatus = undefined
processForm.processRemark = ''
}
//
//
async function handleProcessSubmit() {
const { processStatus, processRemark } = processForm
if (!processStatus) {
message.warning('请选择处理结果')
return
}
processSubmitting.value = true
try {
// ID
const orderIds = currentProcessRecords.map(record => record.raw.id)
const { success } = await apis.workOrder.workerOrderErrorCheck({
orderIDs: orderIds, // ID
status: processStatus,
reason: processRemark,
})
if (success) {
message.success(`成功处理 ${orderIds.length} 条异常工单`)
processModalVisible.value = false
await getMenuList() //
//
selectedRowKeys.value = []
selectedRows.value = []
} else {
message.warning('处理失败')
}
} catch (error) {
console.error('处理异常工单失败:', error)
message.error('处理失败,请重试')
} finally {
processSubmitting.value = false
}
}
/** /**
* 获取菜单列表 * 获取异常工单列表
* @return {Promise<void>}
*/ */
async function getMenuList() { async function getMenuList() {
try { try {
showLoading() showLoading()
const { pageSize, current } = paginationState const { pageSize, current } = paginationState
const { success, data, total } = await apis.workOrder.getAbnormalWorkOrderList({ const { success, data, total } = await apis.workOrder.getAbnormalWorkOrderList({
stationId:storage.local.getItem('stationId'), stationId: storage.local.getItem('stationId'),
companyId:storage.local.getItem('companyId'), companyId: storage.local.getItem('companyId'),
pageSize, pageSize,
current: current, current: current,
...searchFormData.value, ...searchFormData.value,
}) })
// if (success) {
const mappedData = data.map(item => ({ //
id: item.orderNum || item.id, // id orderNum const mappedData = data.map(item => ({
orderId: item.orderNum || '-', // id: item.id,
customerName: item.customerName || '-', // orderId: item.orderNum || '-',
identityNo: item.customerIdCard || '-', // customerName: item.customerName || '-',
serviceUserName: item.serviceName || '-', // identityNo: item.customerIdCard || '-',
itemNames: item.projects?.map(p => p.name).join('、') || '-', // serviceUserName: item.serviceName || '-',
realStartTime: item.signInAt, // formatUtcDateTime itemNames: item.projects?.map(p => p.name).join('、') || '-',
realEndTime: item.signOutAt, // realStartTime: item.signInAt ? formatUtcDateTime(item.signInAt) : '-',
processStatus: item.processStatus === '1' ? '已处理' : item.processStatus === '0' ? '未处理' : '未知', // realEndTime: item.signOutAt ? formatUtcDateTime(item.signOutAt) : '-',
processRemark: item.reason || '-', // processStatus: item.processStatus === '1' ? '已处理' : item.processStatus === '0' ? '未处理' : '未知',
processUserName: item.userName || '-', // processRemark: item.reason || '-',
processTime: dayjs(item.processAt).format('YYYY-MM-DD HH:mm:ss'), // processUserName: item.userName || '-',
serviceAddress: item.detailAddress || '-', // processTime: item.processAt ? dayjs(item.processAt).format('YYYY-MM-DD HH:mm:ss') : '-',
// 便 id serviceAddress: item.detailAddress || '-',
raw: item, // 便
})) raw: item,
}))
listData.value = mappedData listData.value = mappedData
paginationState.total = total paginationState.total = total
hideLoading() } else {
message.error('获取数据失败')
}
} catch (error) { } catch (error) {
console.error('获取工单列表失败:', error) console.error('获取异常工单列表失败:', error)
hideLoading()
message.error('获取数据失败') message.error('获取数据失败')
} finally {
hideLoading()
} }
} }
/** /**
* 搜索 * 搜索
*/ */
function handleSearch() { function handleSearch() {
// resetForm()
resetPagination() resetPagination()
getMenuList() getMenuList()
} }
/** /**
* 重置 * 重置
*/ */
@ -282,35 +334,7 @@ function handleResetSearch() {
resetPagination() resetPagination()
getMenuList() getMenuList()
} }
/**
* 删除
* @param id
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.menu.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.menu.delMenu(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getMenuList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/** /**
* 编辑完成 * 编辑完成
*/ */
@ -318,59 +342,8 @@ async function onOk() {
await getMenuList() await getMenuList()
} }
//
// getMenuList()
function handleSingleProcess(record) {
currentProcessRecords = [record]
processForm.processStatus = record.processStatus || undefined
processForm.processRemark = record.processRemark || ''
processModalVisible.value = true
}
//
async function handleProcessSubmit() {
const { processStatus } = processForm
if (!processStatus ) {
message.warning('请选择处理结果')
return
}
processSubmitting.value = true
// try {
// // API apis.order.batchProcess({ ids, processStatus, processRemark })
// const ids = currentProcessRecords.map(r => r.id)
// const { success } = await apis.order.batchProcess({
// ids,
// processStatus,
// processRemark,
// })
// if (config('http.code.success') === success) {
// message.success('')
// processModalVisible.value = false
// await getOrderList() //
// }
// } catch (error) {
// message.error('')
// } finally {
// processSubmitting.value = false
// }
}
async function handleView(record = {}) {
showModal({
type: 'view',
title: '查看详情',
})
const { data } = await apis.menu.getMenu(record.id).catch(() => {
throw new Error()
})
formData.value = cloneDeep(data)
formData.value.properties = formData.value.properties ? JSON.parse(formData.value.properties) : ''
formData.value.resources = formData.value.resources || (formData.value.resources = [])
platform.value=data.platform
}
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped></style>