Merge branch 'master' of http://gitea.bugtc.com/zhouyanli/property-manager-side
This commit is contained in:
69
wuye-manager-uniapp/.gitignore
vendored
69
wuye-manager-uniapp/.gitignore
vendored
@@ -1,5 +1,68 @@
|
||||
node_modules/
|
||||
unpackage/
|
||||
.hbuilderx/
|
||||
# 系统缓存文件
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
*.swp
|
||||
*.swo
|
||||
|
||||
# 编辑器配置
|
||||
.idea/
|
||||
.vscode/
|
||||
*.iml
|
||||
*.suo
|
||||
*.sln
|
||||
.history/
|
||||
|
||||
# HBuilderX 本地配置
|
||||
.hbuilderx/
|
||||
.uni-*/
|
||||
|
||||
# 项目依赖
|
||||
node_modules/
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
|
||||
# 证书/密钥(上架用的jks证书千万不能传)
|
||||
*.jks
|
||||
*.keystore
|
||||
*.p12
|
||||
*.key
|
||||
*.pem
|
||||
|
||||
# 编译打包产物
|
||||
unpackage/
|
||||
dist/
|
||||
build/
|
||||
output/
|
||||
|
||||
# 安卓相关
|
||||
androidPrivacy.json
|
||||
*.jks
|
||||
*.keystore
|
||||
*.p12
|
||||
local.properties
|
||||
|
||||
# iOS相关
|
||||
*.mobileprovision
|
||||
*.pem
|
||||
*.cer
|
||||
ios/Pods/
|
||||
ios/build/
|
||||
ios/DerivedData/
|
||||
|
||||
# 日志临时文件
|
||||
*.log
|
||||
temp/
|
||||
tmp/
|
||||
*.tmp
|
||||
|
||||
# 环境配置
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# 其他冗余文件
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* @Author: Zy
|
||||
* @Date: 2026-05-19 16:29:20
|
||||
* @LastEditor: Zy
|
||||
* @LastEditTime: 2026-05-20 08:36:23
|
||||
* @LastEditTime: 2026-05-20 10:45:01
|
||||
*/
|
||||
import request, {
|
||||
get,
|
||||
@@ -104,3 +104,30 @@ export function getTicketMainById(id) {
|
||||
export function ticketComputed(data) {
|
||||
return put('/manage/repair/order', filterParams(data))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 获取工单大厅 工单列表
|
||||
* @param {RequestParams<{
|
||||
* problemStatus:1|2
|
||||
* }>} data
|
||||
* @return { Promise<RowsResult<myOrderListType>>}
|
||||
*/
|
||||
export function getTicketHallList(data) {
|
||||
return get('/manage/repair/order/orderlist', filterParams(data))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 分配 维修人员 - 维修工单
|
||||
* @param {*} data
|
||||
* @return
|
||||
*/
|
||||
export function shareRepairUser(data) {
|
||||
return post('/manage/repair/order/allocate', filterParams(data))
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<view class="tabs_box">
|
||||
<view class="tabs-wrapper">
|
||||
<view
|
||||
class="tabs_box"
|
||||
:style="{
|
||||
height: props.height + 'rpx',
|
||||
lineHeight: props.height + 'rpx'
|
||||
}"
|
||||
>
|
||||
<view
|
||||
v-for="(item, index) in tabs"
|
||||
:key="index"
|
||||
@@ -13,6 +20,7 @@
|
||||
{{ item.label }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -27,6 +35,7 @@ interface TabItem {
|
||||
// Props 类型定义
|
||||
interface Props {
|
||||
tabslist?: any[]
|
||||
height?: number
|
||||
showBottomLine?: boolean
|
||||
// 配置:传入字段名
|
||||
options?: {
|
||||
@@ -39,6 +48,7 @@ interface Props {
|
||||
// 定义 Props
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
tabslist: () => [],
|
||||
height: 60,
|
||||
showBottomLine: true,
|
||||
options: () => ({ label: 'name', value: 'value' }),
|
||||
activeValue: null
|
||||
@@ -75,9 +85,12 @@ const handleTabs = (item: TabItem) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.tabs-wrapper {
|
||||
flex-shrink: 0; /* 关键:不让被压缩 */
|
||||
}
|
||||
.tabs_box {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
/**
|
||||
* 【全局】角色标识枚举
|
||||
* @typedef {'manage'|'repair'|'inspection'|'EquipmentMaintenance'|'complainUser'} RoleKeyEnum
|
||||
*
|
||||
* @enum {RoleKeyEnum}
|
||||
* @property {'manage'} manage - 物业管理员
|
||||
* @property {'repair'} repair - 小区维修人员
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "wuye-uniapp-project",
|
||||
"appid": "__UNI__E4ECDAB",
|
||||
"description": "",
|
||||
"name" : "花开物业管家端",
|
||||
"appid" : "__UNI__29C3D60",
|
||||
"description" : "智慧社区管家端,专为小区物业管理人员打造,支持多小区灵活切换管理。集成账号密码、手机号密码双重登录模式,内置忘记密码找回功能,保障账号安全。涵盖消息通知、日常巡检、故障报修、一键开门、工单流转、投诉处理等核心办公功能,物业人员可在线完成巡检打卡、问题上报、工单派发跟进、投诉对接处理等日常工作,同时支持查看个人上报记录、巡检历史,便捷修改账号信息与登录密码。高效简化社区物业办公流程,提升小区服务与管理效率,打造便捷智能的社区管理服务平台。",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
@@ -41,9 +41,16 @@
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios": {},
|
||||
"ios" : {
|
||||
"dSYMs" : false
|
||||
},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {}
|
||||
"sdkConfigs" : {
|
||||
"push" : {}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"useOriginalMsgbox" : true
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
@@ -66,5 +73,9 @@
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion": "3"
|
||||
"vueVersion" : "3",
|
||||
"locale" : "zh-Hans",
|
||||
"fallbackLocale" : "zh-Hans"
|
||||
}
|
||||
/* ios打包配置 *//* SDK配置 */
|
||||
|
||||
|
||||
@@ -4,12 +4,17 @@
|
||||
<!-- 状态筛选标签 -->
|
||||
<TabsComponents
|
||||
:showBottomLine="false"
|
||||
:activeValue="activeStatus"
|
||||
:tabslist="statusTabs"
|
||||
@update="switchStatus"
|
||||
></TabsComponents>
|
||||
|
||||
<view class="detail_list flex flex-1 overflow-auto">
|
||||
<scroll-view scroll-y="true" lower-threshold="160" @scrolltolower="scrolltolower">
|
||||
<scroll-view
|
||||
style="height: 100%; flex: 1"
|
||||
scroll-y="true"
|
||||
lower-threshold="160"
|
||||
@scrolltolower="scrolltolower"
|
||||
>
|
||||
<view
|
||||
class="item"
|
||||
v-for="(item, index) in list"
|
||||
@@ -107,10 +112,6 @@ function init() {
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
// 2. 开启锁
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
getComplainList(querySearch.value)
|
||||
.then(res => {
|
||||
list.value = [...list.value, ...res.rows]
|
||||
@@ -118,16 +119,27 @@ function init() {
|
||||
// 判断是否还有更多
|
||||
hasMore.value = list.value.length < total.value
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
resetList()
|
||||
})
|
||||
function resetList() {
|
||||
list.value = []
|
||||
querySearch.value.pageNum = 1
|
||||
querySearch.value.pageSize = 10
|
||||
hasMore.value = true
|
||||
init()
|
||||
})
|
||||
}
|
||||
|
||||
// actions
|
||||
function handleComplaint(id: string) {
|
||||
@@ -154,7 +166,10 @@ function scrolltolower() {
|
||||
flex: 1;
|
||||
background: #f9f9f9;
|
||||
padding: 20rpx 40rpx;
|
||||
justify-content: flex-start;
|
||||
align-items: stretch;
|
||||
.detail_list {
|
||||
margin-top: 20rpx;
|
||||
.item {
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
|
||||
@@ -66,12 +66,19 @@ function handleBlur(e) {
|
||||
|
||||
// 处理投诉 提交
|
||||
function handleSelecthouse() {
|
||||
if (checkoutinfo.value.userId) {
|
||||
putComplainProcess({
|
||||
id: form.value.complaintId,
|
||||
handleContent: form.value.handleContent
|
||||
}).then(() => {
|
||||
uni.navigateBack()
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '选择处理人员'
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -6,17 +6,19 @@
|
||||
<view
|
||||
@click="handleClick"
|
||||
class="search_view flex-center"
|
||||
v-if="!queryParmas.value.trim() && Searching"
|
||||
v-if="!queryParmas.keyword.trim() && Searching"
|
||||
>
|
||||
<uni-icons type="search" size="34rpx" color="rgba(0,0,0,0.26)"></uni-icons>
|
||||
<text>请输入关键字进行搜索</text>
|
||||
</view>
|
||||
<uni-easyinput
|
||||
@blur="handleInput"
|
||||
@change="handleSearch"
|
||||
@confirm="handleSearch"
|
||||
@clear="handleClear"
|
||||
@input="handleClear"
|
||||
:focus="true"
|
||||
ref="inputRef"
|
||||
v-model="queryParmas.value"
|
||||
v-model="queryParmas.keyword"
|
||||
v-else
|
||||
/>
|
||||
</view>
|
||||
@@ -67,6 +69,7 @@
|
||||
import { ref, onMounted, getCurrentInstance } from 'vue'
|
||||
import { getSystemUsers_employee } from '@/api/common.js'
|
||||
import navBar from '@/components/navbar/navbar.vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
|
||||
let eventChannel = null
|
||||
onMounted(() => {
|
||||
@@ -81,11 +84,27 @@ function handleClick() {
|
||||
}
|
||||
/** 判断 失去焦点时 切换回 view */
|
||||
function handleInput() {
|
||||
if (queryParmas.value.value.trim()) {
|
||||
if (queryParmas.value.keyword.trim()) {
|
||||
Searching.value = true
|
||||
resetList()
|
||||
} else {
|
||||
queryParmas.value.keyword = ''
|
||||
Searching.value = false
|
||||
resetList()
|
||||
}
|
||||
}
|
||||
function handleSearch() {
|
||||
if (queryParmas.value.keyword.trim()) {
|
||||
resetList()
|
||||
}
|
||||
}
|
||||
function handleClear() {
|
||||
if (queryParmas.value.keyword.trim() === '') {
|
||||
queryParmas.value.keyword = ''
|
||||
Searching.value = true
|
||||
resetList()
|
||||
}
|
||||
}
|
||||
function handleSearch() {}
|
||||
// -----------------------------------------
|
||||
/* 选择列表 */
|
||||
const searchlist = ref([])
|
||||
@@ -93,40 +112,39 @@ const searchlist = ref([])
|
||||
const queryParmas = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
value: ''
|
||||
keyword: ''
|
||||
})
|
||||
const isLoading = ref(false) // 加载锁
|
||||
const hasMore = ref(true) // 是否还有更多数据
|
||||
const total = ref(21)
|
||||
function scrolltolower() {
|
||||
// 必须加这两个判断!
|
||||
if (isLoading.value || !hasMore.value) {
|
||||
return
|
||||
}
|
||||
queryParmas.value.pageNum += 1
|
||||
getlist()
|
||||
}
|
||||
|
||||
function getlist() {
|
||||
// 2. 开启锁
|
||||
if (isLoading.value) {
|
||||
return
|
||||
}
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
getSystemUsers_employee('complainUser', queryParmas.value.value)
|
||||
getSystemUsers_employee('complainUser', queryParmas.value.keyword)
|
||||
.then(res => {
|
||||
searchlist.value = res.data
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
getlist()
|
||||
})
|
||||
|
||||
function resetList() {
|
||||
searchlist.value = []
|
||||
queryParmas.value.pageNum = 1
|
||||
getlist()
|
||||
}
|
||||
//=======================
|
||||
// 选中的人员id
|
||||
const checkoutUserid = ref(null)
|
||||
|
||||
@@ -145,7 +145,7 @@ function init() {
|
||||
.filter(item => item !== false)
|
||||
baseFormData.value = result
|
||||
})
|
||||
.catch(err => {
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
|
||||
@@ -3,7 +3,11 @@
|
||||
<view class="page_padding">
|
||||
<view class="inspection_record_box flex-1 flex flex-col">
|
||||
<navBar @clickLeft="navBack" title="巡检记录"></navBar>
|
||||
<TabsComponents :tabslist="tabslist" @update="handleChangeTabs"></TabsComponents>
|
||||
<TabsComponents
|
||||
:activeValue="activeValue"
|
||||
:tabslist="tabslist"
|
||||
@update="handleChangeTabs"
|
||||
></TabsComponents>
|
||||
<view class="timebox">
|
||||
<view class="daybox flex items-center">
|
||||
<uni-datetime-picker
|
||||
@@ -12,13 +16,15 @@
|
||||
@change="handleChangeTime"
|
||||
v-model="queryParmas.date"
|
||||
>
|
||||
<view class="flex">
|
||||
<view class="day">{{ showDate }}</view>
|
||||
</uni-datetime-picker>
|
||||
<view class="searchiconbox flex items-center">
|
||||
<view class="arrow"> </view>
|
||||
<view class="arrow1"> </view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view
|
||||
class="record_body record-list"
|
||||
@@ -87,6 +93,7 @@ const tabslist = [
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
const activeValue = ref(2)
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
@@ -110,10 +117,6 @@ function getlist() {
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
// 2. 开启锁
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
const { pageNum, pageSize, date, status } = queryParmas.value
|
||||
getInspectionList({
|
||||
pageSize,
|
||||
@@ -134,9 +137,14 @@ function getlist() {
|
||||
hasMore.value = list.value.length < res.total
|
||||
total.value = res.total
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -167,6 +175,7 @@ function scrolltolower() {
|
||||
}
|
||||
|
||||
function handleChangeTabs(val: number) {
|
||||
activeValue.value = val
|
||||
hasMore.value = true
|
||||
queryParmas.value.status = val
|
||||
queryParmas.value.pageNum = 1
|
||||
@@ -182,8 +191,17 @@ function init() {
|
||||
|
||||
onShow(() => {
|
||||
hasMore.value = true
|
||||
init()
|
||||
resetList()
|
||||
})
|
||||
function resetList() {
|
||||
list.value = []
|
||||
queryParmas.value.status = 2
|
||||
queryParmas.value.pageSize = 10
|
||||
queryParmas.value.pageSize = 10
|
||||
hasMore.value = true
|
||||
init()
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
const navBack = () => {
|
||||
uni.navigateBack()
|
||||
@@ -200,7 +218,7 @@ const navBack = () => {
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
.timebox {
|
||||
width: 178rpx;
|
||||
width: 188rpx;
|
||||
height: 48rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 24rpx;
|
||||
@@ -208,7 +226,7 @@ const navBack = () => {
|
||||
line-height: 48rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
margin-top: 20rpx;
|
||||
.daybox {
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
<view class="page_padding">
|
||||
<view class="today_inspection_page flex flex-col">
|
||||
<!-- 状态筛选标签 -->
|
||||
<TabsComponents :tabslist="tabslist" @update="handleTabs"></TabsComponents>
|
||||
<TabsComponents
|
||||
:activeValue="activeValue"
|
||||
:tabslist="tabslist"
|
||||
@update="handleTabs"
|
||||
></TabsComponents>
|
||||
<!-- body -->
|
||||
<view class="inspection_body flex-1" v-if="list.length > 0">
|
||||
<view
|
||||
@@ -97,10 +101,7 @@ const total = ref(0)
|
||||
function getlist() {
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
|
||||
const { pageNum, pageSize, date, status } = queryParmas.value
|
||||
getInspectionList({
|
||||
pageSize,
|
||||
@@ -121,9 +122,14 @@ function getlist() {
|
||||
hasMore.value = list.value.length < res.total
|
||||
total.value = res.total
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
/** 跳转到巡检上传页面 */
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<script setup>
|
||||
import { ref, getCurrentInstance, onMounted } from 'vue'
|
||||
import { getVillageHouseList_keyword } from '@/api/common.js'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
|
||||
const Searching = ref(true)
|
||||
const queryParmas = ref({
|
||||
@@ -116,10 +117,7 @@ function getlist() {
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
// 2. 开启锁
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
|
||||
getVillageHouseList_keyword(queryParmas.value, queryParmas.value.searchValue)
|
||||
.then(res => {
|
||||
// 追加数据(正确方式)
|
||||
@@ -136,10 +134,12 @@ function getlist() {
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
getlist()
|
||||
|
||||
onShow(() => {
|
||||
resetList()
|
||||
})
|
||||
|
||||
// 重置list
|
||||
function resetList() {
|
||||
|
||||
@@ -5,7 +5,11 @@
|
||||
<view class="line"></view>
|
||||
<text class="title">仪表换新记录</text>
|
||||
</view>
|
||||
<TabsComponents :tabslist="tabslist" @update="handleChangeTabs"></TabsComponents>
|
||||
<TabsComponents
|
||||
:activeValue="activeValue"
|
||||
:tabslist="tabslist"
|
||||
@update="handleChangeTabs"
|
||||
></TabsComponents>
|
||||
<view class="instrument_body flex-1 flex">
|
||||
<scroll-view scroll-y lower-threshold="160" @scrolltolower="scrolltolower">
|
||||
<view
|
||||
@@ -75,10 +79,11 @@ const tabslist = [
|
||||
value: 1
|
||||
}
|
||||
]
|
||||
|
||||
const activeValue = ref(0)
|
||||
// 切换tabs
|
||||
function handleChangeTabs(val: number) {
|
||||
queryParmas.value.deviceType = val
|
||||
activeValue.value = val
|
||||
if (val === 0) {
|
||||
queryParmas.value.deviceType = undefined
|
||||
}
|
||||
@@ -111,10 +116,6 @@ function getlist() {
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
// 2. 开启锁
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
const { pageNum, pageSize, deviceType } = queryParmas.value
|
||||
getReplaceMainList({
|
||||
pageNum,
|
||||
@@ -126,15 +127,18 @@ function getlist() {
|
||||
total.value = res.total
|
||||
hasMore.value = infolist.value.length < total.value
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
infolist.value = []
|
||||
hasMore.value = true
|
||||
getlist()
|
||||
resetList()
|
||||
})
|
||||
|
||||
// 重置
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
title="上报记录"
|
||||
backgroundColor="transparent"
|
||||
:border="false"
|
||||
@clickLeft="navBack"/>
|
||||
@clickLeft="navBack"
|
||||
/>
|
||||
|
||||
<!-- 状态筛选标签 -->
|
||||
<view class="status-tabs">
|
||||
@@ -41,13 +42,8 @@
|
||||
scroll-y
|
||||
:style="{ height: `calc(100vh - ${navHeight + statusTabHeight + typeTabHeight}px)` }"
|
||||
>
|
||||
|
||||
<!-- 记录卡片 -->
|
||||
<view
|
||||
v-for="record in reportRecords"
|
||||
:key="record.id"
|
||||
class="record-card"
|
||||
>
|
||||
<view v-for="record in reportRecords" :key="record.id" class="record-card">
|
||||
<!-- 标题 + 状态标签 -->
|
||||
<view class="card-header">
|
||||
<text class="card-title">{{ record.item }}</text>
|
||||
@@ -59,7 +55,9 @@
|
||||
<!-- 类型标签 -->
|
||||
<view class="tag-group">
|
||||
<view class="tag-item" v-if="record.projectTypeStr">{{ record.projectTypeStr }}</view>
|
||||
<view class="tag-item" v-if="record.maintenanceItemName">{{ record.maintenanceItemName}}</view>
|
||||
<view class="tag-item" v-if="record.maintenanceItemName">{{
|
||||
record.maintenanceItemName
|
||||
}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 内容 -->
|
||||
@@ -81,16 +79,14 @@
|
||||
</view>
|
||||
|
||||
<!-- 空数据 -->
|
||||
<view class="empty" v-if="reportRecords.length === 0 && !loading">
|
||||
暂无上报记录
|
||||
</view>
|
||||
<view class="empty" v-if="reportRecords.length === 0 && !loading"> 暂无上报记录 </view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import {onReady, onReachBottom, onPullDownRefresh,onShow} from "@dcloudio/uni-app"
|
||||
import { onReady, onReachBottom, onPullDownRefresh, onShow } from '@dcloudio/uni-app'
|
||||
import { getMyOrderList } from '../../api/api.js'
|
||||
|
||||
// 导航栏/标签高度(适配不同设备)
|
||||
@@ -142,7 +138,8 @@ const getReportList = (isRefresh = false) => {
|
||||
if (activeStatus.value !== 'all') {
|
||||
params.problemStatus = activeStatus.value
|
||||
}
|
||||
getMyOrderList(params).then(res => {
|
||||
getMyOrderList(params)
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
total.value = res.total || 0
|
||||
const data = res.rows || []
|
||||
@@ -157,9 +154,11 @@ const getReportList = (isRefresh = false) => {
|
||||
// 判断是否还有更多
|
||||
noMore.value = reportRecords.value.length >= total.value
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({ title: '加载失败', icon: 'none' })
|
||||
}).finally(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
if (isRefresh) {
|
||||
uni.stopPullDownRefresh()
|
||||
@@ -189,14 +188,14 @@ const reloadList = () => {
|
||||
}
|
||||
|
||||
// 切换状态(全部/待解决/已完成)筛选
|
||||
const switchStatus = (value) => {
|
||||
const switchStatus = value => {
|
||||
if (activeStatus.value === value) return
|
||||
activeStatus.value = value
|
||||
reloadList()
|
||||
}
|
||||
|
||||
// 切换类型(公共/个人)筛选
|
||||
const switchType = (value) => {
|
||||
const switchType = value => {
|
||||
if (activeType.value === value) return
|
||||
activeType.value = value
|
||||
reloadList()
|
||||
@@ -210,19 +209,19 @@ const navBack = () => {
|
||||
}
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status) => {
|
||||
const getStatusText = status => {
|
||||
const statusMap = {
|
||||
// "pending": '已分配',
|
||||
"1": '待解决',
|
||||
'2': '已完成'
|
||||
1: '待解决',
|
||||
2: '已完成'
|
||||
}
|
||||
return statusMap[status] || ''
|
||||
}
|
||||
// 获取状态标签样式类名
|
||||
const getStatusClass = (status) => {
|
||||
const getStatusClass = status => {
|
||||
const classMap = {
|
||||
'1': 'processing',
|
||||
'2': 'completed'
|
||||
1: 'processing',
|
||||
2: 'completed'
|
||||
}
|
||||
return classMap[status] || ''
|
||||
}
|
||||
@@ -236,7 +235,7 @@ onShow(() => {
|
||||
onReady(() => {
|
||||
// 可根据实际设备调整高度
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
success: res => {
|
||||
if (res.platform === 'ios') {
|
||||
navHeight.value = 44
|
||||
} else {
|
||||
@@ -251,7 +250,7 @@ onReady(() => {
|
||||
.report-record-page {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%)
|
||||
background: linear-gradient(to left bottom, #e2efff 0%, #f9f9f9 50%);
|
||||
}
|
||||
.status-bar {
|
||||
width: 100%;
|
||||
@@ -282,7 +281,7 @@ onReady(() => {
|
||||
}
|
||||
|
||||
.status-tab-item.active {
|
||||
color: #4D5DFA;
|
||||
color: #4d5dfa;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
@@ -294,7 +293,7 @@ onReady(() => {
|
||||
transform: translateX(-50%);
|
||||
width: 80rpx;
|
||||
height: 8rpx;
|
||||
background: linear-gradient(to bottom, #4D5DFA, #BAC0FA);
|
||||
background: linear-gradient(to bottom, #4d5dfa, #bac0fa);
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
|
||||
@@ -318,8 +317,8 @@ onReady(() => {
|
||||
}
|
||||
|
||||
.type-tab-item.active {
|
||||
color: #4D5DFA;
|
||||
border: 2rpx solid #4D5DFA;
|
||||
color: #4d5dfa;
|
||||
border: 2rpx solid #4d5dfa;
|
||||
border-radius: 198rpx;
|
||||
/* background-color: #007AFF; */
|
||||
}
|
||||
@@ -363,15 +362,15 @@ onReady(() => {
|
||||
}
|
||||
|
||||
.status-tag.pending {
|
||||
background-color: #E34D59; /* 待分配-红色 */
|
||||
background-color: #e34d59; /* 待分配-红色 */
|
||||
}
|
||||
|
||||
.status-tag.processing {
|
||||
background-color: #09C2BD; /* 待解决-绿色 */
|
||||
background-color: #09c2bd; /* 待解决-绿色 */
|
||||
}
|
||||
|
||||
.status-tag.completed {
|
||||
background-color: #4D5DFA; /* 已完成-蓝色 */
|
||||
background-color: #4d5dfa; /* 已完成-蓝色 */
|
||||
}
|
||||
|
||||
/* 类型标签组 */
|
||||
|
||||
@@ -8,20 +8,44 @@
|
||||
<!-- 手机号输入框 -->
|
||||
<view class="input-item">
|
||||
<view class="input-icon">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/login/phone.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||
<image
|
||||
src="https://wuyeadmin.bugtc.com/images/login/phone.png"
|
||||
mode=""
|
||||
style="height: 100%; width: 100%"
|
||||
></image>
|
||||
</view>
|
||||
<uni-easyinput class="input-content" type="number" v-model="phoneNumber" trim="all"
|
||||
placeholder="请输入手机号" :inputBorder="false" maxlength="11" :placeholderStyle="placeholderStyle">
|
||||
<uni-easyinput
|
||||
class="input-content"
|
||||
type="number"
|
||||
v-model="phoneNumber"
|
||||
trim="all"
|
||||
placeholder="请输入手机号"
|
||||
:inputBorder="false"
|
||||
maxlength="11"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
>
|
||||
</uni-easyinput>
|
||||
</view>
|
||||
<!-- 验证码输入 + 获取验证码按钮 -->
|
||||
<view class="input-item verify-item">
|
||||
<view class="input-icon">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/login/code.png" mode="" style="height: 100%;width: 100%;"></image>
|
||||
<image
|
||||
src="https://wuyeadmin.bugtc.com/images/login/code.png"
|
||||
mode=""
|
||||
style="height: 100%; width: 100%"
|
||||
></image>
|
||||
<!-- <uni-icons type="locked" size="24" color="#999"></uni-icons> -->
|
||||
</view>
|
||||
<uni-easyinput class="input-content verify-input" type="number" v-model="verifyCode" trim="all"
|
||||
placeholder="请输入验证码" :inputBorder="false" maxlength="6" :placeholderStyle="placeholderStyle">
|
||||
<uni-easyinput
|
||||
class="input-content verify-input"
|
||||
type="number"
|
||||
v-model="verifyCode"
|
||||
trim="all"
|
||||
placeholder="请输入验证码"
|
||||
:inputBorder="false"
|
||||
maxlength="6"
|
||||
:placeholderStyle="placeholderStyle"
|
||||
>
|
||||
</uni-easyinput>
|
||||
<button
|
||||
class="get-verify-btn"
|
||||
@@ -32,18 +56,11 @@
|
||||
</button>
|
||||
</view>
|
||||
<!-- 确定 -->
|
||||
<button
|
||||
class="forget-btn"
|
||||
:disabled="!canRegister"
|
||||
@click="handleConfirm"
|
||||
>
|
||||
确定
|
||||
</button>
|
||||
|
||||
<button class="forget-btn" :disabled="!canRegister" @click="handleConfirm">确定</button>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref, computed, onUnmounted } from 'vue';
|
||||
import { ref, computed, onUnmounted } from 'vue'
|
||||
import { getSendCode, changePhone } from '../../api/api.js'
|
||||
|
||||
// ====响应式数据======
|
||||
@@ -51,19 +68,19 @@ const phoneNumber = ref('')
|
||||
const verifyCode = ref('')
|
||||
|
||||
const countDown = ref(0)
|
||||
let timer = null;
|
||||
let timer = null
|
||||
const placeholderStyle = ref('font-size:24rpx')
|
||||
|
||||
// ========== 计算属性 ==========
|
||||
// 是否可获取验证码(手机号格式正确)
|
||||
const canGetVerify = computed(() => {
|
||||
const phoneReg = /^1[3-9]\d{9}$/;
|
||||
return phoneReg.test(phoneNumber.value);
|
||||
});
|
||||
const phoneReg = /^1[3-9]\d{9}$/
|
||||
return phoneReg.test(phoneNumber.value)
|
||||
})
|
||||
|
||||
// 获取验证码
|
||||
const getVerifyCode = () => {
|
||||
if (!canGetVerify.value) return;
|
||||
if (!canGetVerify.value) return
|
||||
let params = {
|
||||
phone: phoneNumber.value,
|
||||
scene: 'butler_login'
|
||||
@@ -73,35 +90,31 @@ const getVerifyCode = () => {
|
||||
uni.showToast({
|
||||
title: '验证码已发送',
|
||||
icon: 'success'
|
||||
});
|
||||
})
|
||||
// 开始60秒倒计时
|
||||
countDown.value = 60;
|
||||
countDown.value = 60
|
||||
timer = setInterval(() => {
|
||||
countDown.value--;
|
||||
countDown.value--
|
||||
if (countDown.value <= 0) {
|
||||
clearInterval(timer);
|
||||
timer = null;
|
||||
clearInterval(timer)
|
||||
timer = null
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
}, 1000)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '验证码发送失败',
|
||||
icon: 'error'
|
||||
});
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
// 是否确认
|
||||
const canRegister = computed(() => {
|
||||
const phoneReg = /^1[3-9]\d{9}$/; // 手机号11位
|
||||
const verifyReg = /^\d{6}$/; // 验证码6位
|
||||
const phoneReg = /^1[3-9]\d{9}$/ // 手机号11位
|
||||
const verifyReg = /^\d{6}$/ // 验证码6位
|
||||
|
||||
return phoneReg.test(phoneNumber.value)
|
||||
&& verifyReg.test(verifyCode.value)
|
||||
});
|
||||
return phoneReg.test(phoneNumber.value) && verifyReg.test(verifyCode.value)
|
||||
})
|
||||
// 确认
|
||||
const handleConfirm = () => {
|
||||
if (!canRegister.value) {
|
||||
@@ -113,22 +126,25 @@ const handleConfirm = () => {
|
||||
changePhone({
|
||||
phone: phoneNumber.value,
|
||||
smsCode: verifyCode.value
|
||||
}).then(res => {
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
uni.showToast({ title: '修改成功', icon: 'success' })
|
||||
// 把参数存到本地缓存
|
||||
uni.setStorageSync('tempChangePwdParams', {
|
||||
phoneNumber: phoneNumber.value
|
||||
});
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 800)
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '修改失败', icon: 'none' })
|
||||
}
|
||||
}).catch(() => {
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({ title: '请求失败,请重试', icon: 'none' })
|
||||
}).finally(() => {
|
||||
})
|
||||
.finally(() => {
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
@@ -136,7 +152,6 @@ const handleConfirm = () => {
|
||||
// const goBack = () => {
|
||||
// uni.navigateBack();
|
||||
// };
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.forget-page {
|
||||
@@ -209,7 +224,7 @@ const handleConfirm = () => {
|
||||
width: 200rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
background-color: #4D5DFA;
|
||||
background-color: #4d5dfa;
|
||||
color: #fff;
|
||||
border-radius: 35rpx;
|
||||
font-size: 28rpx;
|
||||
@@ -226,7 +241,7 @@ const handleConfirm = () => {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
background-color: #4D5DFA;
|
||||
background-color: #4d5dfa;
|
||||
color: #fff;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
@@ -240,6 +255,4 @@ const handleConfirm = () => {
|
||||
.get-verify-btn:after {
|
||||
border-radius: 40px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<!-- 状态筛选标签 -->
|
||||
<TabsComponents
|
||||
:tabslist="statusTabs"
|
||||
:activeValue="activeStatus"
|
||||
:options="{ label: 'label', value: 'value' }"
|
||||
@update="switchStatus"
|
||||
></TabsComponents>
|
||||
@@ -40,49 +41,50 @@
|
||||
>
|
||||
<!-- 标题 + 状态标签 -->
|
||||
<view class="card-header">
|
||||
<text class="card-title">{{ record.title }}</text>
|
||||
<text class="card-title">{{ record.item }}</text>
|
||||
<view
|
||||
class="status-tag"
|
||||
:class="{
|
||||
pending: record.repairStatus === 0,
|
||||
processing: record.repairStatus === 1,
|
||||
completed: record.repairStatus === 2
|
||||
pending: record.problemStatus === statusMap.pending,
|
||||
processing: record.problemStatus === statusMap.processing,
|
||||
completed: record.problemStatus === statusMap.completed
|
||||
}"
|
||||
>
|
||||
{{ getStatusText(record.repairStatus) }}
|
||||
{{ getStatusText(record.problemStatus) }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 类型标签 -->
|
||||
<view class="tag-group">
|
||||
<view class="tag-item">{{ record.reportType }}</view>
|
||||
<view class="tag-item">{{ record.category }}</view>
|
||||
<view class="tag-group" v-if="record.maintenanceItemName || record.projectTypeStr">
|
||||
<view class="tag-item" v-if="record.projectTypeStr">{{ record.projectTypeStr }}</view>
|
||||
<view class="tag-item" v-if="record.maintenanceItemName">{{
|
||||
record.maintenanceItemName
|
||||
}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 内容 -->
|
||||
<view class="card-content">
|
||||
{{ record.content }}
|
||||
{{ record.problem }}
|
||||
</view>
|
||||
<!-- 工单图片 -->
|
||||
<view class="card-image" v-if="record.images.length > 0">
|
||||
<view class="card-image" v-if="record.repairImageUrlList.length > 0">
|
||||
<image
|
||||
lazy-load
|
||||
v-for="(item, index) in record.images"
|
||||
v-for="(item, index) in record.repairImageUrlList"
|
||||
:key="index"
|
||||
:src="item"
|
||||
class="images"
|
||||
mode="scaleToFill"
|
||||
@tap="handlePrivew(record.images)"
|
||||
></image>
|
||||
</view>
|
||||
|
||||
<!-- 底部信息 -->
|
||||
<view class="card-footer">
|
||||
<text class="create-time">{{ record.createTime }}</text>
|
||||
<text v-if="record.repairStatus === 1" class="repairman"
|
||||
>维修师傅:{{ record.repairman }}</text
|
||||
<text v-if="record.problemStatus === statusMap.processing" class="repairman"
|
||||
>维修师傅:{{ record.repairName }}</text
|
||||
>
|
||||
<view class="share" v-if="record.repairStatus === 0">
|
||||
<view class="share" v-if="record.problemStatus === statusMap.pending">
|
||||
<text>分配</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -94,41 +96,44 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, nextTick } from 'vue'
|
||||
import { onReady } from '@dcloudio/uni-app'
|
||||
import { onReady, onShow } from '@dcloudio/uni-app'
|
||||
import TabsComponents from '@/components/tabs/tabs.vue'
|
||||
import NavBar from '@/components/navbar/navbar.vue'
|
||||
|
||||
import { getTicketHallList } from '@/api/ticket.js'
|
||||
// 导航栏/标签高度(适配不同设备)
|
||||
|
||||
// 筛选状态
|
||||
const activeStatus = ref('0') // 全部/待分配/待解决/已完成
|
||||
const activeType = ref('all') // 全部/公共报修/个人报修
|
||||
const activeStatus = ref(-1) // 全部/待分配/待解决/已完成
|
||||
const activeType = ref(-1) // 全部/公共报修/个人报修
|
||||
|
||||
// 0 已提交 1已分配 2维修完成
|
||||
// 状态筛选选项
|
||||
const statusTabs = ref([
|
||||
{ label: '全部', value: 0 },
|
||||
{ label: '待分配', value: 1 },
|
||||
{ label: '待解决', value: 2 },
|
||||
{ label: '已完成', value: 3 }
|
||||
{ label: '全部', value: -1 },
|
||||
{ label: '待分配', value: 0 },
|
||||
{ label: '待解决', value: 1 },
|
||||
{ label: '已完成', value: 2 }
|
||||
])
|
||||
|
||||
// 类型筛选选项
|
||||
const typeTabs = ref([
|
||||
{ label: '全部', value: 'all' },
|
||||
{ label: '公共报修', value: 'public' },
|
||||
{ label: '个人报修', value: 'private' }
|
||||
{ label: '全部', value: -1 },
|
||||
{ label: '公共报修', value: 0 },
|
||||
{ label: '个人报修', value: 1 }
|
||||
])
|
||||
|
||||
// 模拟上报记录数据(实际项目替换为接口请求)
|
||||
const reportRecords = ref([])
|
||||
|
||||
const queryParmas = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 5
|
||||
pageSize: 5,
|
||||
itemType: undefined, // -1 全部/ 0 公共报修/ 1 个人报修
|
||||
problemStatus: undefined // 0 已提交 1已分配 2维修完成
|
||||
})
|
||||
const isLoading = ref(false) // 加载锁
|
||||
const hasMore = ref(true) // 是否还有更多数据
|
||||
const total = ref(21)
|
||||
const total = ref(0)
|
||||
|
||||
function scrolltolower() {
|
||||
// 必须加这两个判断!
|
||||
if (isLoading.value || !hasMore.value) {
|
||||
@@ -137,68 +142,80 @@ function scrolltolower() {
|
||||
queryParmas.value.pageNum += 1
|
||||
getlist()
|
||||
}
|
||||
|
||||
function getlist() {
|
||||
// 1. 如果正在加载或没有更多数据,直接返回
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
// 2. 开启锁
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
getTicketHallList(queryParmas.value)
|
||||
.then(res => {
|
||||
reportRecords.value = [...reportRecords.value, ...res.rows]
|
||||
reportRecords.value.forEach(item => {
|
||||
item.repairImageUrlList = item.repairImageUrl
|
||||
? item.repairImageUrl.split(',').filter(item => item)
|
||||
: []
|
||||
})
|
||||
const { pageNum, pageSize } = queryParmas.value
|
||||
|
||||
const startId = (pageNum - 1) * pageSize + 1
|
||||
const arr = Array.from({ length: pageSize }).map((_, index) => {
|
||||
const realId = startId + index // ✅ 修复 ID 错误
|
||||
|
||||
// ✅ 随机生成 0、1、2
|
||||
const randomStatus = Math.floor(Math.random() * 3)
|
||||
return {
|
||||
id: realId,
|
||||
title: '标题巴拉巴拉巴拉' + startId + 1,
|
||||
status: 'completed',
|
||||
reportType: '公共报修',
|
||||
category: '路灯',
|
||||
content: '1栋楼下道路路灯不亮,并且有的亮度不够,请物业公司及时更换,防止发生意外事故。',
|
||||
createTime: '2026-08-01 10:05:46',
|
||||
images: ['https://picsum.photos/93', 'https://picsum.photos/93', 'https://picsum.photos/93'],
|
||||
repairman: '张三',
|
||||
repairStatus: randomStatus // 0 待分配,1待解决 2已完成
|
||||
}
|
||||
})
|
||||
|
||||
// 追加数据(正确方式)
|
||||
reportRecords.value = [...reportRecords.value, ...arr]
|
||||
// 判断是否还有更多
|
||||
total.value = res.total
|
||||
hasMore.value = reportRecords.value.length < total.value
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络错误'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
getlist()
|
||||
|
||||
onShow(() => {
|
||||
resetList()
|
||||
})
|
||||
|
||||
function resetList() {
|
||||
reportRecords.value = []
|
||||
queryParmas.value.pageNum = 1
|
||||
queryParmas.value.pageSize = 5
|
||||
hasMore.value = true
|
||||
getlist()
|
||||
}
|
||||
|
||||
// 切换状态(全部/待分配/待解决/已完成)筛选
|
||||
const switchStatus = value => {
|
||||
activeStatus.value = value
|
||||
if (value === -1) {
|
||||
queryParmas.value.problemStatus = undefined
|
||||
} else {
|
||||
queryParmas.value.problemStatus = value
|
||||
}
|
||||
resetList()
|
||||
}
|
||||
|
||||
// 切换类型(公共/个人)筛选
|
||||
const switchType = value => {
|
||||
activeType.value = value
|
||||
if (value === -1) {
|
||||
queryParmas.value.itemType = undefined
|
||||
} else {
|
||||
queryParmas.value.itemType = value
|
||||
}
|
||||
resetList()
|
||||
}
|
||||
|
||||
const statusMap = ['待分配', '待解决', '已完成']
|
||||
const statusMap = {
|
||||
已提交: '待分配',
|
||||
已分配: '待解决',
|
||||
已完成: '已完成',
|
||||
|
||||
pending: '已提交',
|
||||
processing: '已分配',
|
||||
completed: '已完成'
|
||||
}
|
||||
// 获取状态文本
|
||||
const getStatusText = status => {
|
||||
return statusMap[status] || ''
|
||||
}
|
||||
|
||||
// 返回上一页
|
||||
const navBack = () => {
|
||||
uni.navigateBack()
|
||||
@@ -334,10 +351,11 @@ function handlePrivew(imgs) {
|
||||
|
||||
.card-title {
|
||||
margin-right: 20rpx;
|
||||
font-weight: 450;
|
||||
font-size: 32rpx;
|
||||
|
||||
font-weight: 400;
|
||||
color: #222222;
|
||||
line-height: 40rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/* 状态标签 */
|
||||
@@ -389,11 +407,11 @@ function handlePrivew(imgs) {
|
||||
/* 内容 */
|
||||
.card-content {
|
||||
margin-bottom: 20rpx;
|
||||
font-weight: 450;
|
||||
letter-spacing: 2rpx;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
line-height: 40rpx;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
/* 图片 */
|
||||
.card-image {
|
||||
@@ -417,6 +435,12 @@ function handlePrivew(imgs) {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
.create-time {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
.share {
|
||||
width: 127rpx;
|
||||
height: 44rpx;
|
||||
@@ -431,6 +455,9 @@ function handlePrivew(imgs) {
|
||||
}
|
||||
|
||||
.repairman {
|
||||
color: #999;
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
color: #999999;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<view class="hall_body flex-1 flex flex-col">
|
||||
<!-- 状态筛选标签 -->
|
||||
<TabsComponents
|
||||
:activeValue="activeStatus"
|
||||
:tabslist="statusTabs"
|
||||
:options="{ label: 'label', value: 'value' }"
|
||||
@update="switchStatus"
|
||||
@@ -140,23 +141,24 @@ function getlist() {
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
// 2. 开启锁
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
})
|
||||
getUserTicketlist(queryParmas.value)
|
||||
.then(res => {
|
||||
reportRecords.value = [...reportRecords.value, ...res.rows]
|
||||
hasMore.value = reportRecords.value.length < total.value
|
||||
total.value = res.total
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
onShow(() => {
|
||||
getlist()
|
||||
resetList()
|
||||
})
|
||||
function resetList() {
|
||||
reportRecords.value = []
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import Stops from '@/components/stops/stops.vue'
|
||||
import { getTicketMainById } from '@/api/ticket.js'
|
||||
import { getTicketMainById, shareRepairUser } from '@/api/ticket.js'
|
||||
// --------------------------------------
|
||||
/** 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成*/
|
||||
const currentStep = ref(2)
|
||||
@@ -203,6 +203,7 @@ onShow(() => {
|
||||
})
|
||||
|
||||
function getTicketById() {
|
||||
if (!queryParams.value.id) return
|
||||
getTicketMainById(queryParams.value.id)
|
||||
.then(res => {
|
||||
repairInfo.value = res.data
|
||||
@@ -225,28 +226,61 @@ function getTicketById() {
|
||||
function handleStop(row) {
|
||||
// 0 已提交 1 已分配 2已解决
|
||||
let status = row.problemStatus
|
||||
|
||||
currentStep.value = 0
|
||||
// 维修步骤:0提交 1分配 2维修完成 / 待解决 3记录完成 完成
|
||||
if (status === '0') {
|
||||
currentStep.value = 1
|
||||
stepList.value[0].desc = '提交报修成功'
|
||||
} else if (status === '1') {
|
||||
return
|
||||
}
|
||||
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') {
|
||||
return
|
||||
}
|
||||
console.log(status)
|
||||
if (status === '2') {
|
||||
currentStep.value = 4
|
||||
stepList.value[0].desc = '提交报修成功'
|
||||
stepList.value[1].title = '已派单'
|
||||
stepList.value[1].desc = '物业已派单'
|
||||
stepList.value[2].title = '已解决'
|
||||
stepList.value[2].desc = `维修人员(${row.repairName})已解决`
|
||||
} else {
|
||||
currentStep.value = 0
|
||||
return
|
||||
}
|
||||
}
|
||||
/** 选择维修人员 */
|
||||
function handleSelecthouse() {
|
||||
uni.navigateTo({
|
||||
url: '/pageSubPack/ticket/shareUser'
|
||||
url: '/pageSubPack/ticket/shareUser',
|
||||
events: {
|
||||
backData: data => {
|
||||
const repairid = data.checkoutUserid
|
||||
if (repairid) {
|
||||
shareRepairUser({
|
||||
id: repairInfo.value.id,
|
||||
repairId: repairid
|
||||
})
|
||||
.then(res => {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
title: '分配成功'
|
||||
})
|
||||
getTicketById()
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -6,44 +6,41 @@
|
||||
<view
|
||||
@click="handleClick"
|
||||
class="search_view flex-center"
|
||||
v-if="!queryParmas.value.trim() && Searching"
|
||||
v-if="!queryParmas.keyword.trim() && Searching"
|
||||
>
|
||||
<uni-icons type="search" size="34rpx" color="rgba(0,0,0,0.26)"></uni-icons>
|
||||
<text>请输入关键字进行搜索</text>
|
||||
</view>
|
||||
<uni-easyinput
|
||||
@blur="handleInput"
|
||||
@change="handleSearch"
|
||||
@confirm="handleSearch"
|
||||
@clear="handleClear"
|
||||
@input="handleClear"
|
||||
:focus="true"
|
||||
ref="inputRef"
|
||||
v-model="queryParmas.value"
|
||||
v-model="queryParmas.keyword"
|
||||
v-else
|
||||
/>
|
||||
</view>
|
||||
<!-- 已经选择人数 -->
|
||||
<view class="checkoutedUser_box">
|
||||
<text>已选({{ checkoutUserid ? 1 : 0 }}/1)</text>
|
||||
<text class="checkoutUseName" v-if="checkoutInfo">{{ checkoutInfo.name }}</text>
|
||||
<text class="checkoutUseName" v-if="checkoutInfo">{{ checkoutInfo.nickName }}</text>
|
||||
</view>
|
||||
<!-- srcoll -->
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
class="flex-1 overflow-auto"
|
||||
lower-threshold="60"
|
||||
@scrolltolower="scrolltolower"
|
||||
>
|
||||
<scroll-view scroll-y="true" class="flex-1 overflow-auto">
|
||||
<radio-group @change="radioChange">
|
||||
<label v-for="(item, index) in searchlist" :key="index">
|
||||
<view
|
||||
class="item flex items-center justify-between"
|
||||
:class="{
|
||||
active: checkoutUserid === item.id
|
||||
active: checkoutUserid === item.userId
|
||||
}"
|
||||
>
|
||||
<view class="">
|
||||
<view class="info">
|
||||
<text>姓名:</text>
|
||||
<text>{{ item.name }}</text>
|
||||
<text>{{ item.nickName }}</text>
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>角色:</text>
|
||||
@@ -51,10 +48,10 @@
|
||||
</view>
|
||||
<view class="info">
|
||||
<text>手机号码:</text>
|
||||
<text>{{ item.phone }}</text>
|
||||
<text>{{ item.phonenumber }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<radio color="#4d5dfa" :value="item.id" />
|
||||
<radio color="#4d5dfa" :value="item.userId" />
|
||||
</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
@@ -71,6 +68,9 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, getCurrentInstance } from 'vue'
|
||||
import navBar from '@/components/navbar/navbar.vue'
|
||||
import { getSystemUsers_employee } from '@/api/common.js'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
|
||||
const Searching = ref(true)
|
||||
/** 点击时切换到input,并聚焦 */
|
||||
function handleClick() {
|
||||
@@ -78,73 +78,74 @@ function handleClick() {
|
||||
}
|
||||
/** 判断 失去焦点时 切换回 view */
|
||||
function handleInput() {
|
||||
if (queryParmas.value.value.trim()) {
|
||||
if (queryParmas.value.keyword.trim()) {
|
||||
Searching.value = true
|
||||
resetList()
|
||||
} else {
|
||||
queryParmas.value.keyword = ''
|
||||
Searching.value = false
|
||||
resetList()
|
||||
}
|
||||
}
|
||||
function handleSearch() {
|
||||
if (queryParmas.value.keyword.trim()) {
|
||||
resetList()
|
||||
}
|
||||
}
|
||||
function handleClear() {
|
||||
if (queryParmas.value.keyword.trim() === '') {
|
||||
queryParmas.value.keyword = ''
|
||||
Searching.value = true
|
||||
resetList()
|
||||
}
|
||||
}
|
||||
function handleSearch() {}
|
||||
// -----------------------------------------
|
||||
/* 选择列表 */
|
||||
const searchlist = ref([])
|
||||
|
||||
const queryParmas = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
value: ''
|
||||
keyword: '',
|
||||
roleKey: 'repair'
|
||||
})
|
||||
const isLoading = ref(false) // 加载锁
|
||||
const hasMore = ref(true) // 是否还有更多数据
|
||||
const total = ref(21)
|
||||
function scrolltolower() {
|
||||
// 必须加这两个判断!
|
||||
if (isLoading.value || !hasMore.value) {
|
||||
return
|
||||
}
|
||||
queryParmas.value.pageNum += 1
|
||||
getlist()
|
||||
}
|
||||
|
||||
function getlist() {
|
||||
// 1. 如果正在加载或没有更多数据,直接返回
|
||||
if (isLoading.value || !hasMore.value) return
|
||||
if (isLoading.value) return
|
||||
// 2. 开启锁
|
||||
isLoading.value = true
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true
|
||||
const { keyword, roleKey } = queryParmas.value
|
||||
getSystemUsers_employee(roleKey, keyword)
|
||||
.then(res => {
|
||||
searchlist.value = res.data
|
||||
})
|
||||
const { pageNum, pageSize } = queryParmas.value
|
||||
|
||||
const startId = (pageNum - 1) * pageSize + 1
|
||||
const arr = Array.from({ length: pageSize }).map((_, index) => {
|
||||
const realId = startId + index
|
||||
const randomStatus = Math.floor(Math.random() * 3)
|
||||
return {
|
||||
name: '张三' + realId,
|
||||
roleName: '维修人员',
|
||||
phone: '19578012123',
|
||||
id: realId
|
||||
}
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: '网络异常'
|
||||
})
|
||||
// 追加数据(正确方式)
|
||||
searchlist.value = [...searchlist.value, ...arr]
|
||||
// 判断是否还有更多
|
||||
hasMore.value = searchlist.value.length < total.value
|
||||
})
|
||||
.finally(() => {
|
||||
isLoading.value = false
|
||||
uni.hideLoading()
|
||||
})
|
||||
}
|
||||
getlist()
|
||||
|
||||
onShow(() => {
|
||||
resetList()
|
||||
})
|
||||
|
||||
function resetList() {
|
||||
reportRecords.value = []
|
||||
searchlist.value = []
|
||||
queryParmas.value.pageNum = 1
|
||||
hasMore.value = true
|
||||
getlist()
|
||||
}
|
||||
//searchlist----------------------
|
||||
const checkoutUserid = ref(null)
|
||||
const checkoutInfo = ref(null)
|
||||
function radioChange(val) {
|
||||
checkoutUserid.value = Number(val.detail.value)
|
||||
const find = searchlist.value.find(item => item.id === Number(val.detail.value))
|
||||
checkoutUserid.value = val.detail.value
|
||||
const find = searchlist.value.find(item => item.userId === val.detail.value)
|
||||
if (find) {
|
||||
checkoutInfo.value = find
|
||||
}
|
||||
@@ -161,12 +162,14 @@ onMounted(() => {
|
||||
/* 确定派单 */
|
||||
function handleSelecthouse() {
|
||||
// api
|
||||
if (eventChannel) {
|
||||
eventChannel.emit('backData', {
|
||||
checkoutUserid: checkoutUserid.value
|
||||
})
|
||||
// 3. 返回上一页
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
// ===========================================
|
||||
</script>
|
||||
|
||||
|
||||
@@ -271,12 +271,6 @@
|
||||
"^uni-(.*)": "@/components/uni-$1.vue"
|
||||
}
|
||||
},
|
||||
"condition": {
|
||||
"list": [{
|
||||
"name": "维修完成",
|
||||
"path": "pageSubPack/ticket/repairCompleted"
|
||||
}]
|
||||
},
|
||||
"tabBar": {
|
||||
"color": "#333333",
|
||||
"backgroundColor": "#F5F6F6",
|
||||
|
||||
@@ -15,12 +15,18 @@
|
||||
<view class="header-container" @click="navigateToPage">
|
||||
<view class="location-area">
|
||||
<view class="location-icon">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/adress.png" style="height: 100%; width: 100%"></image>
|
||||
<image
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/adress.png"
|
||||
style="height: 100%; width: 100%"
|
||||
></image>
|
||||
</view>
|
||||
<view class="community-selector">
|
||||
<text class="community-name">{{ currentCommunity }}</text>
|
||||
<view class="community-icon">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/三角形.png" style="height: 100%; width: 100%"></image>
|
||||
<image
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/三角形.png"
|
||||
style="height: 100%; width: 100%"
|
||||
></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -50,7 +56,10 @@
|
||||
<!-- 消息通知栏 -->
|
||||
<view class="noticeClass">
|
||||
<view class="notice-left">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/imgs/notice.png" class="notice-icon"></image>
|
||||
<image
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/notice.png"
|
||||
class="notice-icon"
|
||||
></image>
|
||||
<view class="notice-line"></view>
|
||||
</view>
|
||||
<view class="notice-right" @click="getNoticeMore">
|
||||
@@ -91,26 +100,46 @@
|
||||
<!-- 第一行功能:故障上报、一键开门、工单大厅、我的工单 -->
|
||||
<view class="function-row">
|
||||
<view class="function-item" @click="goToReport">
|
||||
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/fault-report.png" mode="aspectFit"></image>
|
||||
<image
|
||||
class="item-icon"
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/fault-report.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="item-text">故障上报</text>
|
||||
</view>
|
||||
<view class="function-item" @click="goToOneOpenDoor">
|
||||
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/open.png" mode="aspectFit"></image>
|
||||
<image
|
||||
class="item-icon"
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/open.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="item-text">一键开门</text>
|
||||
</view>
|
||||
<view class="function-item" @tap="goToTicketHall">
|
||||
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/work-order.png" mode="aspectFit"></image>
|
||||
<image
|
||||
class="item-icon"
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/work-order.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="item-text">工单大厅</text>
|
||||
</view>
|
||||
<view class="function-item" @tap="goToMyTicket">
|
||||
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/my-work.png" mode="aspectFit"></image>
|
||||
<image
|
||||
class="item-icon"
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/my-work.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="item-text">我的工单</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 第二行 -->
|
||||
<view class="function-row" style="margin-top: 2px">
|
||||
<view class="function-item" @tap="goToComplaint">
|
||||
<image class="item-icon" src="https://wuyeadmin.bugtc.com/images/imgs/complaint.png" mode="aspectFit"></image>
|
||||
<image
|
||||
class="item-icon"
|
||||
src="https://wuyeadmin.bugtc.com/images/imgs/complaint.png"
|
||||
mode="aspectFit"
|
||||
></image>
|
||||
<text class="item-text">投诉处理</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -122,8 +151,12 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onLoad, onUnload } from '@dcloudio/uni-app'
|
||||
import { getCurrentVillage,getTodayInspection,getNewNoticeData,getBannarList} from '../../api/api.js'
|
||||
|
||||
import {
|
||||
getCurrentVillage,
|
||||
getTodayInspection,
|
||||
getNewNoticeData,
|
||||
getBannarList
|
||||
} from '../../api/api.js'
|
||||
|
||||
// 列表数据状态
|
||||
const current = ref(0)
|
||||
@@ -212,7 +245,8 @@ const currentVillageData = () => {
|
||||
}
|
||||
// 获取今日巡检数据
|
||||
const getInspectionData = () => {
|
||||
getTodayInspection().then(res =>{
|
||||
getTodayInspection()
|
||||
.then(res => {
|
||||
if (res.code === 200) {
|
||||
if (res.data) {
|
||||
allCount.value = res.data.totalTasks
|
||||
@@ -226,7 +260,8 @@ const getInspectionData = () =>{
|
||||
} else {
|
||||
uni.showToast({ title: res.msg || '获取失败', icon: 'none' })
|
||||
}
|
||||
}).catch(err => {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
|
||||
})
|
||||
}
|
||||
@@ -244,13 +279,15 @@ const getNoticeData = () => {
|
||||
}
|
||||
// 获取bannar图
|
||||
function getbannarData() {
|
||||
getBannarList().then(res => {
|
||||
getBannarList()
|
||||
.then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
bannerList.value = res.data
|
||||
} else {
|
||||
bannerList.value = []
|
||||
}
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
|
||||
// 接收选择小区返回的参数
|
||||
|
||||
@@ -46,13 +46,15 @@ const avatar = ref('')
|
||||
const statusBarHeight = ref(uni.getSystemInfoSync().statusBarHeight || 0)
|
||||
|
||||
const fetchUserInfo = () => {
|
||||
getSettingInfo().then(res => {
|
||||
getSettingInfo()
|
||||
.then(res => {
|
||||
if (res.code === 200 && res.data) {
|
||||
loginName.value = res.data.nickName || ''
|
||||
phoneNum.value = res.data.phonenumber || ''
|
||||
avatar.value = res.data.avatar || ''
|
||||
}
|
||||
}).catch(err => {
|
||||
})
|
||||
.catch(err => {
|
||||
uni.showToast({ title: err.msg || '获取失败', icon: 'none' })
|
||||
})
|
||||
}
|
||||
@@ -63,10 +65,10 @@ onShow(() => {
|
||||
|
||||
const onItemClick = item => {
|
||||
const routes = {
|
||||
'上报记录': '/pageSubPack/report-record/report-record',
|
||||
'巡检记录': '/pageSubPack/inspection/inspection_record',
|
||||
'仪表换新': '/pageSubPack/instrument/replacement_record',
|
||||
'设置': '/pageSubPack/setting/setting'
|
||||
上报记录: '/pageSubPack/report-record/report-record',
|
||||
巡检记录: '/pageSubPack/inspection/inspection_record',
|
||||
仪表换新: '/pageSubPack/instrument/replacement_record',
|
||||
设置: '/pageSubPack/setting/setting'
|
||||
}
|
||||
const url = routes[item.title]
|
||||
if (!url) return
|
||||
|
||||
Reference in New Issue
Block a user