维修工单详情

This commit is contained in:
Zy
2026-05-19 18:25:10 +08:00
parent abc8086ad0
commit 0de58216f0
2 changed files with 124 additions and 54 deletions

View File

@@ -3,7 +3,7 @@
* @Author: Zy * @Author: Zy
* @Date: 2026-05-19 16:29:20 * @Date: 2026-05-19 16:29:20
* @LastEditor: Zy * @LastEditor: Zy
* @LastEditTime: 2026-05-19 17:15:09 * @LastEditTime: 2026-05-19 17:39:23
*/ */
import request, { import request, {
get, get,
@@ -52,13 +52,38 @@ export function getUserTicketlist(data) {
/**
* @typedef TicketMainInfoTyp 维修工单信息
* @property {String} id = [工单ID]
* @property {String} houseId = [维修房屋ID]
* @property {String} houseName = [维修房屋地址]
* @property {String} isCheckStr = [状态已读]
* @property {String} item = [标题]
* @property {String} maintenanceItemId = [维修项目ID]
* @property {String} maintenanceItemName = [维修项目名称]
* @property {String} manageIsCheck = [管理人员 已读]
* @property {String} orderDate = [工单日期]
* @property {String} phone = [报修用户 联系方式]
* @property {String} problem = [报修描述]
* @property {String} problemImageUrl = [报修图片]
* @property {String} problemStatus = [报修状态]
* @property {String} projectType = [报修项目类型]
* @property {String} projectTypeStr = [报修 项目 名称]
* @property {String} repairDes = [维修描述]
* @property {String} repairId = [维修ID]
* @property {String} repairImageUrl = [维修描述]
* @property {String} repairIsCheck = [维修人员 已读]
* @property {String} residentName = [报修用户名称]
* @property {String} residentId = [报修用户ID]
* @property {String} repairName = [维修人员名称]
*/
/** /**
* @description: 获取工单详细信息 by id * @description: 获取工单详细信息 by id
* @param {string} id * @param {string} id
* @return * @return { Promise<DataResult<TicketMainInfoTyp>>}
*/ */
export function getTicketMainById(id) { export function getTicketMainById(id) {
return get('/manage/repair/order/orderdetail', data) return get('/manage/repair/order/orderdetail', {
id,
})
} }

View File

@@ -16,12 +16,15 @@
</view> </view>
<view class="flex justify-between"> <view class="flex justify-between">
<span class="subtitle">{{ data.desc }}</span> <span class="subtitle">{{ data.desc }}</span>
<span class="subtime" v-if="currentStep > index">2026/08/01 10:30:35</span> <span class="subtime" v-if="currentStep == index + 1">{{
repairInfo.updateTime
}}</span>
</view> </view>
</view> </view>
</template> </template>
</Stops> </Stops>
</view> </view>
<view class="info"> <view class="info">
<view class="info_title"> <view class="info_title">
<text>保修信息</text> <text>保修信息</text>
@@ -36,19 +39,19 @@
<view class="item"> <view class="item">
<view class="label"> <text>维修项目</text> </view> <view class="label"> <text>维修项目</text> </view>
<view class="value"> <view class="value">
<text>{{ repairInfo.repairProject }} </text> <text>{{ repairInfo.maintenanceItemName }} </text>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
<view class="label"> <text>标题</text> </view> <view class="label"> <text>标题</text> </view>
<view class="value"> <view class="value">
<text> {{ repairInfo.title }}</text> <text> {{ repairInfo.item }}</text>
</view> </view>
</view> </view>
<view class="item descrition"> <view class="item descrition">
<view class="label"> <text>问题描述</text> </view> <view class="label"> <text>问题描述</text> </view>
<view class="value"> <view class="value">
<text>{{ repairInfo.descrtion }}</text> <text>{{ repairInfo.problem }}</text>
</view> </view>
</view> </view>
<view class="item"> <view class="item">
@@ -60,14 +63,14 @@
<view class="item"> <view class="item">
<view class="label"> <text>报修时间</text> </view> <view class="label"> <text>报修时间</text> </view>
<view class="value"> <view class="value">
<text> {{ repairInfo.time }} </text> <text> {{ repairInfo.createTime }} </text>
</view> </view>
</view> </view>
<view class="item photobox"> <view class="item photobox">
<view class="label"> <text>问题照片</text> </view> <view class="label"> <text>问题照片</text> </view>
<view class="value"> <view class="value" v-if="problemImageUrl.length > 0">
<image <image
v-for="(item, index) in repairInfo.photo" v-for="(item, index) in problemImageUrl"
:key="index" :key="index"
class="images" class="images"
:src="item" :src="item"
@@ -78,37 +81,44 @@
</view> </view>
</view> </view>
<view class="info" v-if="(currentStep >= 2 && prevPath === 'hall') || currentStep > 2"> <view
class="info"
v-if="
(currentStep >= 2 && prevPath === 'hall') || (currentStep >= 2 && prevPath === 'myticket')
"
>
<view class="info_title"> <view class="info_title">
<text>维修信息</text> <text>维修信息</text>
</view> </view>
<view class="info_body"> <view class="info_body">
<view class="item"> <view class="item">
<view class="label"> <text>姓名</text> </view> <view class="label"> <text>姓名</text> </view>
<view class="value"> {{ repairInfo.repairUser.name }} </view> <view class="value"> {{ repairInfo.repairName }} </view>
</view> </view>
<view class="item"> <view class="item">
<view class="label"> <text>状态</text> </view> <view class="label"> <text>状态</text> </view>
<view class="value"> {{ repairInfo.repairUser.status }} </view> <view class="value"> {{ repairInfo.problemStatus }} </view>
</view> </view>
<view class="item"> <view class="item">
<view class="label"> <text>角色</text> </view> <view class="label"> <text>角色</text> </view>
<view class="value"> {{ repairInfo.repairUser.role }} </view> <!-- <view class="value"> {{ repairInfo.repairUser.role }} </view> -->
</view> </view>
<view class="item"> <view class="item">
<view class="label"> <text>手机号</text> </view> <view class="label"> <text>手机号</text> </view>
<view class="value"> {{ repairInfo.repairUser.phone }} </view> <!-- <view class="value"> {{ repairInfo.repairUser.phone }} </view> -->
</view> </view>
<view class="" v-if="currentStep >= 3"> <view class="" v-if="currentStep >= 3">
<view class="item descrition flex-col"> <view class="item descrition flex-col">
<view class="label"> <text>问题描述</text> </view> <view class="label"> <text>问题描述</text> </view>
<view class="value"> {{ repairInfo.repairUser.descrtion }} </view> <view class="value" v-if="repairInfo.repairDes && repairInfo.repairDes.trim()">
{{ repairInfo.repairDes }}
</view>
</view> </view>
<view class="item photobox"> <view class="item photobox">
<view class="label"> <text>问题照片</text> </view> <view class="label"> <text>问题照片</text> </view>
<view class="value"> <view class="value" v-if="repairImageUrl.length > 0">
<image <image
v-for="(item, index) in repairInfo.repairUser.photo" v-for="(item, index) in repairImageUrl"
:key="index" :key="index"
class="images" class="images"
:src="item" :src="item"
@@ -137,47 +147,52 @@ import { getTicketMainById } from '@/api/ticket.js'
// -------------------------------------- // --------------------------------------
/** 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成*/ /** 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成*/
const currentStep = ref(2) const currentStep = ref(2)
// 步骤数据 // 步骤数据
const stepList = ref([ const stepList = ref([
{ title: '提交维修信息', desc: '提交报修成功', time: '2026/08/01 10:30:26' }, { title: '提交维修信息', desc: '等待提交报修' },
{ title: '待分配', desc: '等待物业派单中', time: '2026/08/01 10:32:21' }, { title: '待分配', desc: '等待物业派单中' },
{ title: '维修/待解决', desc: '维修人员进行维修', time: '2026/08/01 10:38:07' }, { title: '待解决', desc: '等待维修人员' },
{ title: '维修完成', desc: '填写维修记录', time: '2026/08/01 10:40:33' } { title: '维修完成', desc: '填写维修记录' }
]) ])
// -------------------------------------- // --------------------------------------
const queryParams = ref({ const queryParams = ref({
id: null id: null
}) })
// 展示 button
const Showbtn = ref(false) const Showbtn = ref(false)
// 上一个页面地址
const prevPath = ref('') const prevPath = ref('')
// 工单信息
const repairInfo = ref({ const repairInfo = ref({
houseName: '桂花园(别墅)2号楼2层', createTime: null,
repairProject: '照明-路灯', houseId: null,
title: '1栋楼下道路灯不亮了', houseName: '',
descrtion: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。', id: '',
phone: '15688888888', isCheckStr: null,
time: '2023-08-01 15:30', item: '',
photo: [ maintenanceItemId: '',
'https://picsum.photos/80', maintenanceItemName: '',
'https://picsum.photos/80', manageIsCheck: '',
'https://picsum.photos/80', orderDate: '',
'https://picsum.photos/80' phone: '',
], problem: '',
repairUser: { problemImageUrl: '',
name: '盘下但', problemStatus: '1',
status: '正常', projectType: null,
role: '维修人员', projectTypeStr: '',
phone: '15688888888', repairDes: '',
descrtion: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。', repairId: '',
photo: [ repairImageUrl: '',
'https://picsum.photos/80', repairIsCheck: '',
'https://picsum.photos/80', repairName: '',
'https://picsum.photos/80', residentId: '',
'https://picsum.photos/80' residentName: '',
] updateTime: ''
}
}) })
// 报修图片
const problemImageUrl = ref([])
// 维修图片
const repairImageUrl = ref([])
onLoad(options => { onLoad(options => {
queryParams.value.id = options.id queryParams.value.id = options.id
@@ -191,7 +206,16 @@ onShow(() => {
function getTicketById() { function getTicketById() {
getTicketMainById(queryParams.value.id) getTicketMainById(queryParams.value.id)
.then(res => { .then(res => {
console.log(res) repairInfo.value = res.data
problemImageUrl.value = repairInfo.value.problemImageUrl
? repairInfo.value.problemImageUrl.split(',')
: []
repairImageUrl.value = repairInfo.value.repairImageUrl
? repairInfo.value.repairImageUrl.split(',')
: []
handleStop(res.data)
}) })
.catch(err => { .catch(err => {
console.log(err) console.log(err)
@@ -199,6 +223,27 @@ function getTicketById() {
} }
// -------------------------------------- // --------------------------------------
function handleStop(row) {
// 0 已提交 1 已分配 2已解决
let status = row.problemStatus
// 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成
if (status === '0') {
currentStep.value = 1
stepList.value[0].desc = '提交报修成功'
} else if (status === '1') {
currentStep.value = 2
stepList.value[1].title = '已派单'
stepList.value[1].desc = '物业已派单'
stepList.value[2].title = '待解决'
stepList.value[2].desc = `维修人员(${row.repairName})维修中`
} else if (status === '2') {
currentStep.value = 4
stepList.value[2].title = '已解决'
stepList.value[2].desc = `维修人员(${row.repairName})已解决`
} else {
currentStep.value = 0
}
}
/** 选择维修人员 */ /** 选择维修人员 */
function handleSelecthouse() { function handleSelecthouse() {
uni.navigateTo({ uni.navigateTo({
@@ -254,12 +299,12 @@ function handleRepairCompluted() {
} }
.subtitle { .subtitle {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 22rpx;
line-height: 40rpx; line-height: 40rpx;
} }
.subtime { .subtime {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 22rpx;
color: #999999; color: #999999;
line-height: 40rpx; line-height: 40rpx;
} }
@@ -330,7 +375,7 @@ function handleRepairCompluted() {
font-size: 28rpx; font-size: 28rpx;
color: #222222; color: #222222;
line-height: 36rpx; line-height: 36rpx;
width: 45%; width: 35%;
} }
.value { .value {
flex: 1; flex: 1;