generated from Leo_Ding/web-template
异常工单修改
This commit is contained in:
parent
65ea48af37
commit
729403c391
@ -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
|
||||||
})
|
})
|
||||||
|
|||||||
@ -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>
|
||||||
@ -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,14 +216,62 @@ 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()
|
||||||
@ -238,42 +285,47 @@ async function getMenuList() {
|
|||||||
...searchFormData.value,
|
...searchFormData.value,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (success) {
|
||||||
// 字段映射
|
// 字段映射
|
||||||
const mappedData = data.map(item => ({
|
const mappedData = data.map(item => ({
|
||||||
id: item.orderNum || item.id, // 如果没有 id,可以用 orderNum 代替,或后端补充
|
id: item.id,
|
||||||
orderId: item.orderNum || '-', // 工单号
|
orderId: item.orderNum || '-',
|
||||||
customerName: item.customerName || '-', // 姓名
|
customerName: item.customerName || '-',
|
||||||
identityNo: item.customerIdCard || '-', // 身份证号
|
identityNo: item.customerIdCard || '-',
|
||||||
serviceUserName: item.serviceName || '-', // 服务人员
|
serviceUserName: item.serviceName || '-',
|
||||||
itemNames: item.projects?.map(p => p.name).join('、') || '-', // 服务项目(多个用顿号连接)
|
itemNames: item.projects?.map(p => p.name).join('、') || '-',
|
||||||
realStartTime: item.signInAt, // 签入时间(保持原格式,formatUtcDateTime 会处理)
|
realStartTime: item.signInAt ? formatUtcDateTime(item.signInAt) : '-',
|
||||||
realEndTime: item.signOutAt, // 签出时间
|
realEndTime: item.signOutAt ? formatUtcDateTime(item.signOutAt) : '-',
|
||||||
processStatus: item.processStatus === '1' ? '已处理' : item.processStatus === '0' ? '未处理' : '未知', // 处理状态(根据实际枚举调整)
|
processStatus: item.processStatus === '1' ? '已处理' : item.processStatus === '0' ? '未处理' : '未知',
|
||||||
processRemark: item.reason || '-', // 处理原因
|
processRemark: item.reason || '-',
|
||||||
processUserName: item.userName || '-', // 处理人
|
processUserName: item.userName || '-',
|
||||||
processTime: dayjs(item.processAt).format('YYYY-MM-DD HH:mm:ss'), // 处理时间
|
processTime: item.processAt ? dayjs(item.processAt).format('YYYY-MM-DD HH:mm:ss') : '-',
|
||||||
serviceAddress: item.detailAddress || '-', // 服务地址
|
serviceAddress: item.detailAddress || '-',
|
||||||
// 原始数据保留,便于后续操作(如提交处理时用 id)
|
// 原始数据保留,便于后续操作
|
||||||
raw: item,
|
raw: item,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
listData.value = mappedData
|
listData.value = mappedData
|
||||||
paginationState.total = total
|
paginationState.total = total
|
||||||
hideLoading()
|
} else {
|
||||||
} catch (error) {
|
|
||||||
console.error('获取工单列表失败:', error)
|
|
||||||
hideLoading()
|
|
||||||
message.error('获取数据失败')
|
message.error('获取数据失败')
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取异常工单列表失败:', 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>
|
||||||
Loading…
x
Reference in New Issue
Block a user