1.报事报修

This commit is contained in:
2025-09-06 16:37:22 +08:00
parent 7c0a09d534
commit 3718586e12
12 changed files with 571 additions and 74 deletions

View File

@@ -29,6 +29,10 @@ const install = (Vue, vm) => {
getOrdersType:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrdersType/list',params),
//报事报修订单类型
getRepairTypes:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrdersType/queryList',params),
//工单详情
getRepairDetail:(params = {}, id) => vm.$u.get(config.adminPath+`/property/workOrders/{id}`,params),
//新增订单
addOrder:(params = {})=>vm.$u.post(config.adminPath+'/property/workOrders',params),
//新增报事报修

View File

@@ -13,7 +13,8 @@
<view class="search-bar">
<image class="search-icon" src="/static/ic_search_gray.png" />
<input class="search-input" placeholder="姓名、工号" />
<input class="search-input" placeholder="姓名" v-model="keyword" @confirm="handleSearch" confirm-type="search" />
<view class="search-btn" @click="handleSearch">搜索</view>
</view>
@@ -24,7 +25,7 @@
<text>{{ item.name }}{{ item.department }}</text>
</view>
</scroll-view>
<button class="footer" @click="confirm">{{ confirmText }}</button>
</view>
</view>
@@ -58,13 +59,18 @@
data() {
return {
keyword: '',
selected: []
selected: [],
allList: [], // 存放所有数据
filteredList: []
}
},
computed: {
filteredList() {
if (!this.keyword) return this.list;
return this.list.filter(item => item.name.includes(this.keyword) || item.value.includes(this.keyword));
watch: {
list: {
handler(newVal) {
this.allList = [...newVal];
this.filteredList = [...newVal];
},
immediate: true
}
},
methods: {
@@ -89,7 +95,18 @@
this.$emit('confirm', this.selected);
this.close();
},
onSearch() {}
// 搜索方法
handleSearch() {
if (!this.keyword) {
this.filteredList = [...this.allList];
return;
}
this.filteredList = this.allList.filter(item =>
item.name.includes(this.keyword) ||
(item.department && item.department.includes(this.keyword))
);
}
}
}
</script>
@@ -147,38 +164,48 @@
right: 30rpx;
}
.search-bar {
display: flex;
align-items: center;
background: #F7F7F7;
border-radius: 29rpx;
height: 58rpx;
padding-left: 20rpx;
margin-left: 34rpx;
margin-right: 34rpx;
margin-top: 26rpx;
}
.search-icon {
width: 27rpx;
height: 27rpx;
margin-right: 8rpx;
}
.search-input {
border: none;
font-size: 26rpx;
flex: 1;
color: #000;
.search-bar {
display: flex;
align-items: center;
background: #F7F7F7;
border-radius: 29rpx;
height: 58rpx;
padding-left: 20rpx;
margin-left: 34rpx;
margin-right: 34rpx;
margin-top: 26rpx;
}
.search-icon {
width: 27rpx;
height: 27rpx;
margin-right: 8rpx;
}
.search-input {
border: none;
font-size: 26rpx;
flex: 1;
color: #000;
background: transparent;
}
.search-btn {
font-size: 26rpx;
color: #0090FF;
padding: 0 20rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.user-list {
flex: 1;
overflow-y: auto;
margin-top: 20rpx;
padding-left: 52rpx;
overflow-y: auto;
margin-top: 20rpx;
padding-left: 52rpx;
padding-right: 52rpx;
}
.user-item {
.user-item {
height: 88rpx;
display: flex;
align-items: center;
@@ -207,8 +234,8 @@
background: #0090FF;
color: #fff;
border-radius: 44rpx;
font-size: 36rpx;
margin-top: 50rpx;
font-size: 36rpx;
margin-top: 50rpx;
margin-bottom: 50rpx;
}
</style>

View File

@@ -351,6 +351,18 @@
"style": {
"navigationBarTitleText": "新增报事报修"
}
},
{
"path": "pages/sys/user/myRepair/repairDetail",
"style": {
"navigationBarTitleText": "报事详情"
}
},
{
"path": "pages/sys/user/myRepair/addSuc",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/sys/user/myRepair/selectLocation",

View File

@@ -19,7 +19,7 @@
<!-- 白色圆角面板 -->
<view class="mine-panel">
<view class="mine-list">
<view class="mine-list-item" v-for="(item, idx) in list" :key="idx" @click="handleItemClick(idx)">
<view class="mine-list-item" v-for="(item, idx) in list" :key="idx" @click="handleItemClick(item.id)">
<image class="mine-list-icon" :src="item.icon" />
<text class="mine-list-text">{{ item.text }}</text>
<text v-if="item.extra" class="mine-list-extra">{{ item.extra }}</text>
@@ -40,36 +40,45 @@
nickname: '',
phone:''
},
list: [{
icon: '/static/ic_mine_info.png',
text: '我的信息'
},
{
icon: '/static/ic_mine_pay.png',
text: '我的缴费'
},
{
icon: '/static/ic_mine_repair.png',
text: '我的报修'
},
{
icon: '/static/ic_mine_visitor.png',
text: '我的访客'
},
{
list: [
// {
// id:0,
// icon: '/static/ic_mine_info.png',
// text: '我的信息'
// },
// {
// id:1,
// icon: '/static/ic_mine_pay.png',
// text: '我的缴费'
// },
// {
// id:2,
// icon: '/static/ic_mine_repair.png',
// text: '我的报修'
// },
// {
// id:3,
// icon: '/static/ic_mine_visitor.png',
// text: '我的访客'
// },
{
id:4,
icon: '/static/ic_mine_check.png',
text: '我的考勤'
},
{
{
id:5,
icon: '/static/ic_mine_pwd.png',
text: '修改密码'
},
{
{
id:6,
icon: '/static/ic_mine_version.png',
text: '系统版本',
extra: 'v1.00.01'
},
{
{
id:7,
icon: '/static/ic_mine_setting2.png',
text: '设置'
}

View File

@@ -141,7 +141,11 @@
// 关闭页面前发送事件通知前页面刷新
uni.$emit('refreshData', '');
// 返回上一页
uni.navigateBack();
uni.navigateBack();
const itemStr = encodeURIComponent(JSON.stringify(this.repairInfo));
uni.navigateTo({
url: "/pages/sys/user/myRepair/addSuc?item=" + itemStr,
});
}else{
uni.showToast({
title: res.msg,

View File

@@ -0,0 +1,127 @@
<template>
<view class="success-container">
<!-- 成功图标 -->
<view class="repaired-navbar">
<image src="/static/ic_back.png" class="repaired-back" @click="goBack" />
<text v v-if="false" class="repaired-progress" @click="goProgress">查看进度</text>
</view>
<image src="/static/ic_sub_suc.png" class="img" />
<!-- 提交成功标题 -->
<view class="success-title">提交成功</view>
<!-- 提示信息 -->
<view class="success-desc">提交成功后我们将及时为您服务</view>
<!-- 返回首页按钮 -->
<button class="back-home-btn" @click="goBack">返回首页</button>
</view>
</template>
<script>
export default {
data() {
return {
detail: {}
};
},
onLoad(options) {
if (options.item) {
const item = JSON.parse(decodeURIComponent(options.item));
this.detail = item;
console.log("t1",this.detail)
}
},
methods: {
goBack() {
uni.navigateBack();
},
goProgress() {
const itemStr = encodeURIComponent(JSON.stringify(this.detail));
uni.navigateTo({
url: "/pages/sys/user/myRepair/repairDetail?item=" + itemStr,
});
}
// async getDetial() {
// let handlers = await this.$u.api.getRepairDetail({}, this.detail.id);
// if (handlers.code === 200) this.users = [...this.users, ...handlers.data];
// },
}
}
</script>
<style scoped>
.success-container {
display: flex;
flex-direction: column;
align-items: center;
height: 100vh;
background-color: #fff;
}
.success-icon {
margin-bottom: 20rpx;
}
.success-icon image {
width: 80rpx;
height: 80rpx;
}
.success-title {
font-size: 38rpx;
color: #333;
margin-bottom: 40rpx;
}
.success-desc {
font-size: 28rpx;
color: #80333333;
margin-bottom: 246rpx;
}
.back-home-btn {
width: 524rpx;
height: 92rpx;
line-height: 92rpx;
text-align: center;
background: linear-gradient(to right, #00C7FF, #0096FF);
color: #fff;
border-radius: 22rpx;
font-size: 28rpx;
}
.repaired-navbar {
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
justify-content: flex-start;
position: relative;
margin-top: 40rpx;
}
.repaired-back {
width: 18rpx;
height: 32rpx;
margin-left: 24rpx;
}
.repaired-progress {
position: absolute;
right: 36rpx;
top: 50%;
transform: translateY(-50%);
font-size: 24rpx;
color: #333;
}
.img {
width: 150rpx;
height: 150rpx;
margin-top: 150rpx;
margin-bottom: 40rpx;
}
</style>

View File

@@ -32,7 +32,7 @@
</view>
<image class="repair-line-image" src="/static/ic_my_repair_03.png" />
<view class="repair-info">建立时间{{ item.createTime }}</view>
<view class="repair-info">报事内容{{ item.typeName }}</view>
<view class="repair-info">工单类型{{ item.typeName }}</view>
<view class="repair-info">报事位置{{ item.location }}</view>
<view v-if="getStatusLabel(item.status) === '已结束'" class="repair-eval-btn eval-btn-right">服务评价</view>
</view>
@@ -179,7 +179,7 @@
goDetail(item) {
const itemStr = encodeURIComponent(JSON.stringify(item));
uni.navigateTo({
url: "/pages/sys/workbench/order/orderDetail?item=" + itemStr,
url: "/pages/sys/user/myRepair/repairDetail?item=" + itemStr,
});
},
showDetail(item) {

View File

@@ -0,0 +1,263 @@
<template>
<view class="page-container">
<view class="top-line" />
<view class="item-bg"><text class="detail-key">工单编号</text>{{ detail.orderNo }}</view>
<view class="item-bg">
<view class="item-title">上报人信息</view>
<view class="detail-key">发起人{{ detail.initiatorPeople }}</view>
<view class="detail-key">联系电话{{ detail.initiatorPhone }}</view>
</view>
<view class="item-bg">
<view class="item-title">保修信息</view>
<view class="detail-key">工单名称{{ detail.orderName }}</view>
<view class="detail-key">工单类型{{ detail.typeName }}</view>
<view class="detail-key">处理地点{{ detail.location }}</view>
<view class="detail-key">备注{{ detail.remark }}</view>
<view class="detail-value"><text class="detail-key">工单图片</text></view>
<view class="image-list" v-if="orderImgUrls.length > 0">
<u-image
v-for="(imgUrl, index) in orderImgUrls"
:key="index"
:src="imgUrl"
width="200rpx"
height="200rpx"
border-radius="10rpx"
@click="previewImage(orderImgUrls, index)"
style="margin-right: 20rpx; margin-bottom: 20rpx;"
mode="aspectFill"
></u-image>
</view>
</view>
<view v-if="detail.status>1" class="item-bg">
<view class="item-title">负责人信息</view>
<view class="detail-key">负责人{{ detail.handlerText }}</view>
<view class="detail-key">联系电话{{ detail.handlerPhone }}</view>
</view>
<!-- 纵向进度条 -->
<view class="item-bg">
<view class="item-title">进度跟踪</view>
<view v-for="(status, index) in detail.recordVoList" :key="index" class="repair-detail-step">
<view class="step-left">
<text class="step-date">{{ status.createTime.substring(0,11)}}</text>
<text class="step-time">{{ status.createTime.substring(11,16) }}</text>
</view>
<view class="step-dot-container">
<view class="repair-detail-dot" ></view>
<!-- 固定高度连线 -->
<view
v-if="index < detail.recordVoList.length - 1" class="repair-detail-line"
></view>
</view>
<view class="step-right">
<text class="step-name">{{ getStatusLabel(status.status) }}</text>
</view>
</view>
</view>
<!-- 底部操作按钮 -->
<view
v-if="((!isManager && detailStep != 0) || (isManager && detailStep == 0)) && detailStep != 3&&!isNaomalUser"
class="btn-group">
<button class="btn ghost"
@click="transfer(1)">{{ isManager ? '指派' : (detailStep == 2 ? '完成' : '开始') }}</button>
<button v-if="detailStep == 1" class="btn primary" @click="transfer(2)">转派</button>
</view>
<view class="kg">
</view>
<SelectUser :visible.sync="showSelect" :list="users" :multiple="false" @confirm="onConfirm" />
</view>
</template>
<script>
import SelectUser from '@/components/SelectUser.vue'
export default {
components: { SelectUser },
data() {
return {
detailStep: 0,
detailStatus: '',
currentStatus: 2,
detail: {},
isManager: false,
isNaomalUser:true,
showSelect: false,
users: [],
orderImgUrls: []
};
},
onLoad(options) {
this.isManager = this.vuex_user?.roles?.[0]?.roleId < 3
// this.isNaomalUser = this.vuex_user?.roles?.[0]?.roleId >10
this.isNaomalUser = false
if (options.item) {
const item = JSON.parse(decodeURIComponent(options.item));
this.detail = item;
this.getStepInfo()
this.getImageUrl()
}
if ((this.isManager && this.detailStep == 0) || (!this.isManager && this.detailStep == 1)) {
this.getHandler()
}
},
methods: {
goBack() { uni.navigateBack(); },
async getImageUrl() {
if (!this.detail.orderImgUrl) return;
const imgIds = this.detail.orderImgUrl.split(',');
const res = await this.$u.api.getImageUrl({}, imgIds.join(','));
if (res.code == 200 && res.data) this.orderImgUrls = res.data.map(item => item.url);
},
async getHandler() {
let handlers = await this.$u.api.getHandler3({}, this.detail.type);
if (handlers.code === 200) this.users = [...this.users, ...handlers.data];
},
getStepInfo() {
let currentIndex = 0;
if (this.detail.status == 0) currentIndex = 0;
else if (this.detail.status == 1) currentIndex = 1;
else if (this.detail.status == 3) currentIndex = 2;
else if (this.detail.status == 4) currentIndex = 3;
this.detailStep = currentIndex;
console.log('t1',this.de)
},
getStatusLabel(status) {
const statusMap = {
0: "创建工单",
1: "已接单",
2: "已接单",
3: "处理中",
4: "已完成",
};
return statusMap[status] || "";
},
previewImage(urls, index) {
const validUrls = urls.filter(url => url && url.trim() !== '');
const currentIndex = validUrls.indexOf(urls[index]);
uni.previewImage({
urls: validUrls,
current: currentIndex >= 0 ? currentIndex : 0,
indicator: 'number',
backgroundColor: '#000'
})
},
async onConfirm(selected) {
let params = this.detail
params.handler = selected[0].value
params.status = 1
let res = await this.$u.api.updateOrder2(params);
if (res.code == '200') {
uni.$emit('refreshData', '');
if(!this.isManager){
uni.navigateBack();
return
}
this.detail.handler = selected.value
this.detail.status = 1
const d = new Date();
const z = n => n.toString().padStart(2, '0');
let time = `${d.getFullYear()}-${z(d.getMonth()+1)}-${z(d.getDate())} ${z(d.getHours())}:${z(d.getMinutes())}:${z(d.getSeconds())}`;
let step = {}
step.id= this.detail.recordVoList[0].id,
step.orderId= this.detail.recordVoList[0].orderId,
step.status= '1',
step.handler='',
step.handlerName='',
step.createTime= time
this.detail.recordVoList.push(step)
this.getStepInfo()
}
},
async submit() {
let params = this.detail
if (this.detail.status == 1 || this.detail.status == 2) params.status = 3
else params.status = 4
let res = await this.$u.api.updateOrder2(params);
if (res.code == 200) {
uni.$emit('refreshData', '');
this.detail.status = params.status
if(params.status ==3){
this.detail.handlerText = this.vuex_user.nickName
this.detail.handlerPhone = this.vuex_user.phonenumber
}
const d = new Date();
const z = n => n.toString().padStart(2, '0');
let time = `${d.getFullYear()}-${z(d.getMonth()+1)}-${z(d.getDate())} ${z(d.getHours())}:${z(d.getMinutes())}:${z(d.getSeconds())}`;
let step = {}
step.id= this.detail.recordVoList[0].id,
step.orderId= this.detail.recordVoList[0].orderId,
step.status= params.status,
step.handler='',
step.handlerName='',
step.createTime= time
this.detail.recordVoList.push(step)
this.getStepInfo()
}
},
transfer(type) {
if (this.isManager || type == 2) this.showSelect = true
else this.submit()
}
}
}
</script>
<style scoped>
.page-container { background: #f7f7f7; height: 100vh; }
.top-line { width: 100vw; height: 3rpx; background: #ECECEC; }
.item-bg{ background: #fff; border-radius: 20rpx; margin-top: 10px; margin-left: 25rpx; margin-right: 25rpx; padding: 25rpx; }
.item-title{ color: #000; font-size: 28rpx; font-weight: 600; margin-bottom: 20rpx; }
.repair-detail-step-container { display: flex; flex-direction: column; }
.repair-detail-step {
display: flex;
flex-direction: row;
margin-bottom: 20rpx;
}
.step-left { flex: 1; display: flex; flex-direction: column; align-items: flex-end; padding-right: 20rpx; }
.step-date { font-size: 24rpx; color: #333; }
.step-time { font-size: 24rpx; color: #666; margin-top: 10rpx; }
.step-dot-container {
display: flex;
flex-direction: column;
align-items: center;
width: 40rpx;
}
.repair-detail-dot {
width: 22rpx;
height: 22rpx;
border-radius: 50%;
background: #BDBDBD;
border: 2rpx solid #BDBDBD;
z-index: 2;
background: #2186FF;
border-color: #2186FF;
}
/* 固定高度连线 */
.repair-detail-line {
width: 4rpx;
height: 80rpx; /* 每条线的高度 */
background: #BDBDBD;
margin-top: 2rpx;
background: #2186FF;
}
.step-right { flex: 1; display: flex; flex-direction: column; padding-left: 20rpx; }
.step-name { font-size: 28rpx; color: #333; font-weight: bold; margin-bottom: 6rpx; }
.step-desc { font-size: 24rpx; color: #666; }
.detail-key { color: #222; font-size: 28rpx; margin-bottom: 20rpx; }
.detail-value { margin-bottom: 30rpx; color: #2F2F2F; }
.image-list { display: flex; flex-wrap: wrap; margin-top: 20rpx; }
.btn-group { display: flex; justify-content: space-around; margin-top: 60rpx; }
.btn { width: 276rpx; height: 88rpx; padding: 20rpx; font-size: 30rpx; border-radius: 50rpx; display: flex; align-items: center; justify-content: center; }
.primary { background-color: #1890ff; color: #fff; }
.ghost { background-color: #fff; color: #1890ff; border: 2rpx solid #1890ff; }
.kg{
height: 60rpx;
}
</style>

View File

@@ -152,13 +152,13 @@
});
},
beforeSubmit() {
if(!this.isSign){
uni.showToast({
title: '请先签到',
icon: 'none'
});
return
}
// if(!this.isSign){
// uni.showToast({
// title: '请先签到',
// icon: 'none'
// });
// return
// }
if (this.info.inspectionResults == 1) {
// 直接提交
this.submit();

View File

@@ -30,6 +30,27 @@
{{ item.pointName }}
<view>
{{ item.pointStartTime.substring(0,16) }} - {{ item.pointEndTime.substring(0,16) }}
</view>
<!-- 添加3个子项 -->
<view v-if="item.inspectionState != 0">
<view class="status" @click="goDetail(item)">
<view>完成巡检</view>
<view class="badge" :class="item.inspectionResults ==1 ? 'badge-success' : 'badge-warn'">
{{ item.inspectionResults == 1 ? '正常' : '异常' }}
</view>
</view>
<view class="sub-item">
<view class="sub-dot"></view>
<view class="sub-text">提报时间 {{ item.inspectorName || '未知' }}</view>
</view>
<view class="sub-item">
<view class="sub-dot"></view>
<view class="sub-text">处理时间{{ item.actualInspectionTime || '未知' }}</view>
</view>
<view class="sub-item">
<view class="sub-dot"></view>
<view class="sub-text">完成时间{{ item.remarks || '无' }}</view>
</view>
</view>
</view>
@@ -44,6 +65,7 @@
{{ item.inspectionResults == 1 ? '正常' : '异常' }}
</view>
</view>
</view>
</view>
</view>
@@ -109,13 +131,13 @@
uni.navigateTo({
url: `/pages/sys/workbench/inspection/inspectionOpt?item=${detailItemStr}`
});
},
goDetail(item) {
// const detailItemStr = encodeURIComponent(JSON.stringify(item));
// uni.navigateTo({
// url: `/pages/sys/workbench/inspection/inspectionDetail?item=${detailItemStr}`
// });
},
goDetail(item) {
// const detailItemStr = encodeURIComponent(JSON.stringify(item));
// uni.navigateTo({
// url: `/pages/sys/workbench/inspection/inspectionDetail?item=${detailItemStr}`
// });
}
}
}
@@ -191,6 +213,35 @@
background: #2f6aff
}
/* 子项 */
.sub-item {
display: flex;
align-items: center;
margin-bottom: 16rpx;
}
.sub-item:last-child {
margin-bottom: 0;
}
/* 子项圆点 */
.sub-dot {
width: 16rpx;
height: 16rpx;
border-radius: 50%;
background-color: #BFBFBF;
margin-right: 20rpx;
flex-shrink: 0;
}
/* 子项文字 */
.sub-text {
font-size: 26rpx;
color: #666;
}
/* 右侧卡片 */
.card {}

View File

@@ -9,7 +9,7 @@
<view class="detail-key">联系电话{{ detail.initiatorPhone }}</view>
</view>
<view class="item-bg">
<view class="item-title">修信息</view>
<view class="item-title">修信息</view>
<view class="detail-key">工单名称{{ detail.orderName }}</view>
<view class="detail-key">工单类型{{ detail.typeName }}</view>
<view class="detail-key">处理地点{{ detail.location }}</view>

BIN
static/ic_sub_suc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB