# Conflicts:
#	wuye-manager-uniapp/pages/index/index.vue
This commit is contained in:
zhouyanli
2026-06-04 17:05:47 +08:00
10 changed files with 60 additions and 37 deletions

View File

@@ -3,7 +3,7 @@
* @Author: Zy
* @Date: 2026-05-16 15:43:07
* @LastEditor: Zy
* @LastEditTime: 2026-05-19 16:25:14
* @LastEditTime: 2026-06-03 18:19:51
*/
import request, {
@@ -41,7 +41,7 @@ import request, {
* */
/**
* @description: 获取巡检任务列表
* @param { RequestParams<{ date?:string }> } data
* @param { RequestParams<{ date:string, status:number }> } data
* @return { Promise<RowsResult<InspectionListType>> }
*/
export const getInspectionList = (data) => {

View File

@@ -9,6 +9,7 @@
* @property {number} total 总条数
* @property {T[]} rows 数据列表
*/
/**
* 返回结果
* @template T

View File

@@ -13,6 +13,7 @@
style="height: 100%; flex: 1"
scroll-y="true"
lower-threshold="160"
v-if="list.length > 0"
@scrolltolower="scrolltolower"
>
<view
@@ -52,6 +53,9 @@
</view>
</view>
</scroll-view>
<view class="nodata" v-else>
<span>暂无数据</span>
</view>
</view>
</view>
</view>
@@ -229,6 +233,12 @@ function scrolltolower() {
}
}
}
.nodata {
text-align: center;
width: 100%;
flex: 1;
}
}
}
</style>

View File

@@ -175,21 +175,22 @@ onLoad(options => {
border-radius: 16rpx;
background-color: #fff;
.title_box {
height: 40rpx;
line-height: 40rpx;
.title {
font-weight: 550;
font-size: 32rpx;
color: #333333;
min-height: 40rpx;
text-wrap: wrap;
line-height: 40rpx;
.line {
display: block;
width: 6rpx;
height: 28rpx;
background: #4d5dfa;
margin-right: 10rpx;
}
}
.inspection_status {
width: 100rpx;
font-weight: 400;
font-size: 28rpx;
color: #666666;

View File

@@ -68,14 +68,14 @@
</view>
<view class="items_picker_box">
<view class="label">
<text v-if="info.inspectSetting === 1" class="is-required">*</text>
<text class="is-required">*</text>
<text>巡检照片</text>
</view>
<view class="filePickerbox" v-if="!ite.complated">
<filePicker
v-model="ite.files"
file-field-name="file"
uploadUrl="/resource/oss/upload"
uploadUrl="/api/butler/file/uploadImage"
@fail="onUploadFail"
></filePicker>
</view>
@@ -106,9 +106,8 @@
<script setup>
import { computed, ref } from 'vue'
import filePicker from '@/components/filePicker/filePicker.vue'
import { getInspectionMain } from '@/api/insepction.js'
import { getInspectionMain, putInsepctionPoint } from '@/api/insepction.js'
import { onLoad } from '@dcloudio/uni-app'
import { putInsepctionPoint } from '@/api/insepction.js'
const statuslist = [
{
@@ -202,15 +201,13 @@ function onUploadFail() {
/** 提交巡检点 检查情况 */
function handleSubmit(item) {
if (info.value.inspectSetting === 1) {
if (item.files.length <= 0) {
uni.showToast({
icon: 'error',
mask: true,
title: '必须拍照'
})
return
}
if (item.files.length <= 0) {
uni.showToast({
icon: 'error',
mask: true,
title: '必须拍照'
})
return
}
let obj = {
pointId: item.pointId,
@@ -271,14 +268,14 @@ function previewImages(images, currentIndex) {
.inspection_title {
margin-bottom: 20rpx;
.title {
font-size: 32rpx;
font-size: 30rpx;
color: #333333;
line-height: 40rpx;
height: 40rpx;
min-height: 40rpx;
text-wrap: wrap;
.line {
display: block;
width: 6rpx;
height: 28rpx;
background: #4d5dfa;
margin-right: 10rpx;
margin-top: 6rpx;
@@ -288,6 +285,7 @@ function previewImages(images, currentIndex) {
font-weight: 400;
font-size: 28rpx;
color: #4d5dfa;
width: 100rpx;
line-height: 36rpx;
}
}

View File

@@ -54,12 +54,12 @@
<script setup lang="ts">
import { ref, computed } from 'vue'
import TabsComponents from '@/components/tabs/tabs.vue'
import { onShow } from '@dcloudio/uni-app'
import { getInspectionList } from '@/api/insepction.js'
import { onShow, onLoad } from '@dcloudio/uni-app'
import { InspectionListType, getInspectionList } from '@/api/insepction.js'
import { parseTime } from '@/utils/time.js'
// tabs =========================================================
const activeValue = ref(0)
const activeValue = ref(2)
const tabslist = ref([
{
name: '全部',
@@ -86,7 +86,7 @@ const isComputed = (status: string) => {
const awaitlist = ['未完成', '待执行', '执行中']
return !awaitlist.includes(status)
}
const list = ref([])
const list = ref<InspectionListType[]>([])
const queryParmas = ref({
date: '',
status: 2,
@@ -133,7 +133,7 @@ function getlist() {
})
}
/** 跳转到巡检上传页面 */
function handleTap(ite) {
function handleTap(ite: InspectionListType) {
if (isComputed(ite.taskStatus)) {
uni.navigateTo({
url: '/pageSubPack/inspection/inspection_main?id=' + ite.id
@@ -151,8 +151,13 @@ function init() {
getlist()
}
onLoad(options => {
activeValue.value = Number(options.type)
console.log(activeValue.value)
})
onShow(() => {
init()
handleTabs(activeValue.value)
})
</script>

View File

@@ -158,10 +158,17 @@ function getlist() {
hasMore.value = reportRecords.value.length < total.value
})
.catch(err => {
uni.showToast({
icon: 'error',
title: '网络错误'
})
if (err.code === 500 && err.msg === '您没有权限访问') {
uni.showToast({
icon: 'error',
title: '没有权限'
})
} else {
uni.showToast({
icon: 'error',
title: '网络异常'
})
}
})
.finally(() => {
isLoading.value = false
@@ -396,8 +403,8 @@ function handlePrivew(imgs) {
}
.tag-item {
width: 112rpx;
height: 42rpx;
padding: 0 10rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 1rpx solid #999999;

View File

@@ -147,7 +147,7 @@ function getlist() {
hasMore.value = reportRecords.value.length < total.value
total.value = res.total
})
.catch(() => {
.catch(err => {
uni.showToast({
icon: 'error',
title: '网络异常'
@@ -392,7 +392,7 @@ function handlePrivew(imgs) {
margin-right: 20rpx;
}
.tag-item {
width: 112rpx;
padding: 0 10rpx;
height: 42rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 1rpx solid #999999;

View File

@@ -241,7 +241,6 @@ function handleStop(row) {
stepList.value[2].desc = `维修人员(${row.repairName})维修中`
return
}
console.log(status)
if (status === '2') {
currentStep.value = 4
stepList.value[0].desc = '提交报修成功'

View File

@@ -156,7 +156,7 @@
<script setup>
import { ref } from 'vue'
import { onLoad, onUnload ,onShow} from '@dcloudio/uni-app'
import { onLoad, onUnload, onShow } from '@dcloudio/uni-app'
import {
getCurrentVillage,
getTodayInspection,
@@ -215,7 +215,7 @@ const goToMyTicket = () => {
// 跳转到 今日巡检
const goToDaysInspection = () => {
uni.navigateTo({
url: '/pageSubPack/inspection/toDays_inscpection'
url: '/pageSubPack/inspection/toDays_inscpection?type=0'
})
}
// 跳转到 巡检记录
@@ -305,10 +305,12 @@ const slelctHomeData = data => {
getNoticeData()
getInspectionData()
}
onShow(()=>{
getbannarData()
getInspectionData()
currentVillageData()
})
onLoad(() => {