From f956955c38a67f968977b7d784ff016ab5b17223 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期六, 30 十一月 2024 16:12:26 +0800
Subject: [PATCH] ll
---
h5/api/yw.js | 50 +++
h5/pages/polling/detail.vue | 211 +++++++++----
h5/pages/workOrder/detail.vue | 2
h5/pages/polling/point.vue | 158 ++++++---
h5/pages/workOrder/edit.vue | 2
h5/pages/operation/record.vue | 25 +
h5/pages/operation/device.vue | 74 +++-
h5/App.vue | 3
h5/manifest.json | 2
h5/pages/polling/task.vue | 81 ++++-
h5/pages/workOrder/list.vue | 325 +++++++++++--------
11 files changed, 619 insertions(+), 314 deletions(-)
diff --git a/h5/App.vue b/h5/App.vue
index 878bfe5..42fad1b 100644
--- a/h5/App.vue
+++ b/h5/App.vue
@@ -18,6 +18,9 @@
body{
font-size: 28rpx;
}
+.primaryColor {
+ color: $primaryColor !important;
+}
.flex-cb {
display: flex;
justify-content: space-between;
diff --git a/h5/api/yw.js b/h5/api/yw.js
index ff980d2..c04116f 100644
--- a/h5/api/yw.js
+++ b/h5/api/yw.js
@@ -70,4 +70,54 @@
url: 'visitsAdmin/cloudService/business/ywDeviceRecord/' + id,
method: 'get'
})
+}
+// 璁惧鍒楄〃
+export const ywDeviceCreate = (data) => {
+ return http({
+ url: 'visitsAdmin/cloudService/business/ywDeviceRecord/create',
+ data
+ })
+}
+// 璁惧鍒楄〃
+export const ywDevicePost = (data) => {
+ return http({
+ url: 'visitsAdmin/cloudService/business/ywDevice/page',
+ data
+ })
+}
+
+// 宸℃浠诲姟鍒楄〃
+export const ywPatrolTaskPost = (data) => {
+ return http({
+ url: 'visitsAdmin/cloudService/business/ywPatrolTask/page',
+ data
+ })
+}
+// 宸℃鐐瑰垪琛�
+export const ywPatrolTaskRecord = (data) => {
+ return http({
+ url: 'visitsAdmin/cloudService/business/ywPatrolTaskRecord/page',
+ data
+ })
+}
+// 宸℃浠诲姟璇︽儏
+export const ywPatrolDetail = (id) => {
+ return http({
+ url: 'visitsAdmin/cloudService/business/ywPatrolTask/' + id,
+ method: 'get'
+ })
+}
+// 宸℃浠诲姟璇︽儏
+export const ywPatrolPointDetail = (id) => {
+ return http({
+ url: 'visitsAdmin/cloudService/business/ywPatrolTaskRecord/' + id,
+ method: 'get'
+ })
+}
+// 宸℃鐐瑰贰妫�
+export const patrolData = (data) => {
+ return http({
+ url: 'visitsAdmin/cloudService/business/ywPatrolTaskRecord/patrolData',
+ data
+ })
}
\ No newline at end of file
diff --git a/h5/manifest.json b/h5/manifest.json
index 952b225..52b48e9 100644
--- a/h5/manifest.json
+++ b/h5/manifest.json
@@ -129,7 +129,7 @@
"/gateway_interface" : {
// 杩欎釜瀛楁鍚嶉渶涓庝綘閰嶇疆鐨刡asePrefixUrl涓�鑷达紝绯荤粺璇嗗埆鍒板甫鏈�/dev-api璇锋眰鐨勫湴鍧�鏃讹紝浼氬湪鍓嶉潰鎷兼帴涓婁唬鐞嗘湇鍔″櫒鍦板潃
// "target" : "http://172.20.10.7:10010", // 浠g悊鏈嶅姟鍣ㄥ煙鍚嶆垨IP鍦板潃
- "target" : "http://192.168.0.108:10030", // 浠g悊鏈嶅姟鍣ㄥ煙鍚嶆垨IP鍦板潃
+ "target" : "http://192.168.0.162:10010", // 浠g悊鏈嶅姟鍣ㄥ煙鍚嶆垨IP鍦板潃
// "target" : "http://10.50.250.253:8088/gateway_interface", // 浠g悊鏈嶅姟鍣ㄥ煙鍚嶆垨IP鍦板潃
// "target" : "http://192.168.0.173/gateway_interface", // 浠g悊鏈嶅姟鍣ㄥ煙鍚嶆垨IP鍦板潃
"changeOrigin" : true, // 鍏佽璺ㄥ煙
diff --git a/h5/pages/operation/device.vue b/h5/pages/operation/device.vue
index 125001a..02c6b7d 100644
--- a/h5/pages/operation/device.vue
+++ b/h5/pages/operation/device.vue
@@ -5,7 +5,7 @@
<view class="la"><text class="red">*</text>閫夋嫨璁惧</view>
<view class="line">
<view class="sel_wrap" @click="showModal = true">
- <view class="left" :class="param.name ? '' : 'placeholder9'">{{ param.name ? param.name : '璇烽�夋嫨璁惧' }}</view>
+ <view class="left" :class="param.deviceName ? '' : 'placeholder9'">{{ param.deviceName ? param.deviceName : '璇烽�夋嫨璁惧' }}</view>
<u-icon name="arrow-right" color="#999999" size="17"></u-icon>
</view>
<image class="icon" src="@/static/side/scan.png" mode=""></image>
@@ -28,9 +28,9 @@
<u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
<view class="mt6">鍥剧墖/瑙嗛</view>
</view>
- <view class="upload_file" v-for="(item, i) in dealFileList" :key="i">
+ <view class="upload_file" v-for="(item, i) in fileList" :key="i">
<u-icon class="close" size="20" name="close-circle-fill" color="red"
- @click="fileDel('dealBeforeFileList', i)"></u-icon>
+ @click="fileDel('fileList', i)"></u-icon>
<image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
<video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
</view>
@@ -39,13 +39,11 @@
<view class="item">
<view class="la">杩愮淮澶囨敞</view>
<view class="line">
- <textarea v-model="param.checkInfo" placeholder="璇疯緭鍏�" placeholder-class="placeholder9" />
+ <textarea v-model="param.content" placeholder="璇疯緭鍏�" placeholder-class="placeholder9" />
</view>
</view>
</view>
- <view class="sub_btn">
- 鎻愪氦
- </view>
+ <view class="sub_btn" @click="onSubmit">鎻愪氦</view>
<!-- -->
<u-popup :show="showUpload" @close="showUpload = false" closeOnClickOverlay>
<view class="sel_upload_wrap">
@@ -62,14 +60,12 @@
<input v-model="searchValue" @confirm="getDevice()" type="text" placeholder="鎼滅储璁惧鍚嶇О/缂栧彿" placeholder-class="placeholder9" />
</view>
<view class="modal_list">
- <view class="item">
- <view class="name">璁惧name</view>
- <image src="@/static/radioed.png" mode=""></image>
+ <view class="item" v-for="item,i in deviceList" @click="deviceClick(item)">
+ <view class="name">{{ item.name }}</view>
+ <image v-if="activeDevice.id == item.id" src="@/static/radioed.png" mode=""></image>
</view>
</view>
- <view class="sub_btn">
- 纭畾閫夋嫨
- </view>
+ <view class="sub_btn" @click="handleDevice">纭畾閫夋嫨</view>
</view>
</u-popup>
</view>
@@ -77,7 +73,9 @@
<script>
import {
- uploadUrl
+ uploadUrl,
+ ywDevicePost,
+ ywDeviceCreate
} from '@/api'
import dayjs from 'dayjs';
export default {
@@ -86,16 +84,52 @@
param: {status: 0},
showUpload: false,
showModal: false,
- dealFileList: [],
+ fileList: [],
searchValue: '',
deviceList: [],
activeDevice: {}
};
},
+ onLoad() {
+ this.getDevice()
+ },
methods: {
- getDevice(){
+ onSubmit() {
+ const { param, fileList } = this
+ if(!param.deviceId) return this.showToast('璇峰厛閫夋嫨瑕佺淮鎶ょ殑璁惧')
+ ywDeviceCreate({
+ ...param,
+ userId: uni.getStorageSync('userInfo').id,
+ dealDate: dayjs().format('YYYY-MM-DD HH:mm:ss'),
+ multifileList: fileList
+ }).then(res => {
+ this.showToast('鎻愪氦鎴愬姛')
+ // uni.navigateBack()
+ })
+ },
+ getDevice(){
+ ywDevicePost({
+ capacity: 9999,
+ page: 1,
+ model: {
+ name: this.searchValue
+ }
+ }).then(res => {
+ this.deviceList = res.data.records || []
+ })
+ },
+ handleDevice() {
+ const { activeDevice } = this
+ if(!activeDevice.id) return this.showToast('璇峰厛閫夋嫨璁惧')
+ this.$set(this.param, 'deviceId', activeDevice.id)
+ this.$set(this.param, 'deviceName', activeDevice.name)
+ this.showModal = false
+ },
+ deviceClick(item) {
+ this.activeDevice = item
+ this.$forceUpdate()
},
statusChange(val){
this.param.status = val
@@ -125,7 +159,7 @@
files: imgs,
name: 'file',
formData: {
- folder: 'HIDDEN_DANGER_FILE'
+ folder: 'YW_DEVICE'
},
header: {
Dm_user_token: token
@@ -137,7 +171,7 @@
i.type = 0;
i.fileurl = i.imgaddr;
i.fileurlFull = i.url;
- this.submitFileList.push(i);
+ this.fileList.push(i);
});
}
},
@@ -171,7 +205,7 @@
},
name: 'file',
formData: {
- folder: 'HIDDEN_DANGER_FILE'
+ folder: 'YW_DEVICE'
},
success: uploadFileRes => {
let res = JSON.parse(uploadFileRes.data);
@@ -180,7 +214,7 @@
i.type = 1;
i.fileurl = i.imgaddr;
i.fileurlFull = i.url;
- this.submitFileList.push(i);
+ this.fileList.push(i);
});
}
},
diff --git a/h5/pages/operation/record.vue b/h5/pages/operation/record.vue
index aaa32ae..18c1025 100644
--- a/h5/pages/operation/record.vue
+++ b/h5/pages/operation/record.vue
@@ -3,11 +3,11 @@
<view class="head_wrap">
<view class="search_wrap">
<image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
- <input v-model="param.keyword" @confirm="getList()" type="text" placeholder="鎼滅储璁惧鍚嶇О/缂栧彿"
+ <input v-model="param.deviceName" @confirm="getList()" type="text" placeholder="鎼滅储璁惧鍚嶇О/缂栧彿"
placeholder-class="placeholder9" />
</view>
<view class="name_wrap" @click="handleMem">
- <view class="name">{{ param.realname ? param.realname : '杩愮淮浜�' }}</view>
+ <view class="name">{{ param.userName ? param.userName : '杩愮淮浜�' }}</view>
<u-icon :name="showModal ? 'arrow-right' : 'arrow-down'" color="#999999" size="12"></u-icon>
</view>
</view>
@@ -57,11 +57,20 @@
this.getpeo()
this.getList()
+ },
+ onReachBottom() {
+ const {total,list} = this
+ if (list.length < total) {
+ this.page = this.page + 1
+ this.getList()
+ } else {
+ this.showToast('鏆傛棤鏇村鏁版嵁')
+ }
},
mounted() {
this.$eventBus.$on('memberSel', (option) => {
- this.$set(this.param, 'realname', option.realname)
- this.$set(this.param, 'memberId', option.id)
+ this.$set(this.param, 'userName', option.realname)
+ this.$set(this.param, 'userId', option.id)
this.getList()
})
@@ -79,7 +88,7 @@
capacity: 10,
model: param
}).then(res => {
- this.list = res.data.records || []
+ this.list = [...this.list, ...res.data.records]
this.total = res.data.total
})
},
@@ -93,8 +102,10 @@
this.columns = [res.data]
})
},
- confirm() {
- this.showModal = false
+ confirm(e) {
+ console.log(e);
+ // this.showModal = false
+ // this.$set(this.param, 'userName', )
},
itemClick(item) {
uni.navigateTo({
diff --git a/h5/pages/polling/detail.vue b/h5/pages/polling/detail.vue
index e2415e9..4d986a3 100644
--- a/h5/pages/polling/detail.vue
+++ b/h5/pages/polling/detail.vue
@@ -1,59 +1,124 @@
<template>
<view class="main_app">
- <view class="head_bg"></view>
- <view class="info">
- <image v-if="true" class="icon" src="@/static/side/ic_dabiaoed.png" mode=""></image>
- <image v-else class="icon" src="@/static/side/ic_dabiao.png" mode=""></image>
+ <view v-if="info.status || info.status == 0" class="head_bg" :style="{
+ background: `linear-gradient(180deg, ${statusM[info.status].color} 0%, rgba(247, 247, 247, 0) 100%)`
+ }"></view>
+ <view class="info">
+ <image v-if="info.status == 2" class="icon" src="@/static/side/ic_dabiaoed.png" mode=""></image>
+ <image v-if="info.status == 3" class="icon" src="@/static/side/ic_dabiao.png" mode=""></image>
<view class="head">
- <view class="name">宸℃璁″垝</view>
- <view class="status">寰呭紑濮�</view>
+ <view class="name">{{ info.title }}</view>
+ <view class="status" v-if="info.status || info.status == 0" :style="{color: statusM[info.status].color}">{{statusM[info.status].name}}</view>
</view>
<view class="line">
<view class="la">浠诲姟鏃ユ湡锛�</view>
- <view class="val">2023-23-23</view>
+ <view class="val" v-if="info.startDate && info.endDate">{{ info.startDate.slice(0, 11) }} 鑷�
+ {{ info.endDate.slice(0, 11) }}</view>
</view>
<view class="line">
<view class="la">鎵ц鏃堕棿锛�</view>
- <view class="val">2023-23-23</view>
+ <view class="val" v-if="info.startDate && info.endDate">{{ info.startDate.slice(11,16) }} 鑷�
+ {{ info.endDate.slice(11, 16) }}</view>
</view>
<view class="line">
<view class="la">瀹屾垚鎯呭喌锛�</view>
- <view class="val">2023-23-23</view>
+ <view class="val">{{info.finishNum}}/{{info.patrolNum}}</view>
</view>
</view>
- <view class="title">宸℃鐐瑰垪琛�(1)</view>
+ <view class="title">宸℃鐐瑰垪琛�({{list.length}})</view>
<view class="list">
- <view class="item" v-for="i in 10" @click="itemClick()">
+ <view class="item" v-for="item in list" @click="itemClick(item)">
<view class="icon"></view>
<view class="content">
<view class="head">
- <view>宸℃鐐�10</view>
- <view class="status">寰呭贰妫�</view>
+ <view>{{item.pointName}}</view>
+ <view class="status" :class="{ gray: item.status == 1 }">{{ item.status == 1 ? '宸插贰妫�' : '寰呭贰妫�' }}</view>
</view>
- <view class="desc">宸℃鍐呭鏈�澶氬睍绀轰袱琛岋紝澶氱殑鐪佺暐宸℃鍐呭鏈�澶氬睍绀轰袱琛岋紝澶氱殑鐪佺暐宸℃鍐呭鏈�澶氬睍绀轰袱琛岋紝澶氱殑鐪佺暐宸℃鍐呭鏈�澶氬睍绀轰袱琛岋紝澶氱殑鐪佺暐宸℃鍐呭鏈�澶氬睍绀轰袱琛岋紝澶氱殑鐪佺暐宸℃鍐呭鏈�澶氬睍绀轰袱琛岋紝澶氱殑鐪佺暐
- </view>
+ <template v-if="item.status == 1">
+ <view class="line">
+ <view class="la">宸℃缁撴灉锛�</view>
+ <view class="val" :class="{ red: item.dealStatus == 1 }">{{ item.dealStatus == 0 ? '姝e父' : '寮傚父' }}</view>
+ </view>
+ <view class="line">
+ <view class="la">宸℃鏃堕棿锛�</view>
+ <view class="val">{{item.dealDate}}</view>
+ </view>
+ </template>
+ <view class="desc" v-else>{{item.content}}</view>
</view>
</view>
</view>
- <view class="footer">
- <view class="sub_btn">鎵爜宸℃</view>
+ <view class="footer">
+ <view class="sub_btn">鎵爜宸℃</view>
</view>
</view>
</template>
<script>
+ import {
+ ywPatrolDetail,
+ ywPatrolTaskRecord
+ } from '@/api'
export default {
data() {
return {
-
+ id: '',
+ info: {},
+ list: [],
+ statusM: [
+ { color: '#4593f7', name: '寰呭紑濮�' },
+ { color: '#73e09a', name: '杩涜涓�' },
+ { color: '#f1a93f', name: '宸茶秴鏈�' },
+ { color: '#b9b9b9', name: '宸插鐞�' },
+ ]
};
+ },
+ onLoad(option) {
+ this.id = option.id
+ this.getDetail()
},
- methods: {
- itemClick() {
- uni.navigateTo({
- url: '/pages/polling/point'
- })
- }
+ onShow() {
+ this.getDetail()
+ },
+ methods: {
+ itemClick(item) {
+ uni.navigateTo({
+ url: '/pages/polling/point?id=' + item.id
+ })
+ },
+ getDetail() {
+ const {
+ id
+ } = this
+ ywPatrolDetail(id).then(res => {
+ this.info = res.data
+ })
+ ywPatrolTaskRecord({
+ capacity: 999,
+ page: 1,
+ model: {
+ taskId: id
+ }
+ }).then(res => {
+ this.list = res.data.records
+ })
+ },
+ async startScan() {
+ try {
+ const video = document.getElementById('video');
+ const stream = await navigator.mediaDevices.getUserMedia({ video: { facingMode: "environment" } });
+ video.srcObject = stream;
+
+ // 浣跨敤 QrScanner 瑙f瀽
+ const qrScanner = new QrScanner(video, result => {
+ alert(`鎵弿缁撴灉: ${result}`);
+ qrScanner.stop(); // 鍋滄鎵爜
+ });
+ qrScanner.start();
+ } catch (err) {
+ console.error('鎵撳紑鎽勫儚澶村け璐�:', err);
+ }
+ }
}
}
</script>
@@ -67,7 +132,7 @@
padding: 30rpx;
.head_bg {
- background: linear-gradient(180deg, #008BFF 0%, rgba(247, 247, 247, 0) 100%);
+ // background: linear-gradient(180deg, #008BFF 0%, rgba(247, 247, 247, 0) 100%);
height: 240rpx;
width: 750rpx;
position: absolute;
@@ -83,14 +148,16 @@
padding: 30rpx 30rpx 10rpx;
margin-bottom: 40rpx;
background: linear-gradient(#FFFFFF 0%, #FFFFFF 48%, #F0F5FF 100%);
- position: relative;
- .icon{
- position: absolute;
- right: 30rpx;
- bottom: 30rpx;
- width: 160rpx;
- height: 122rpx;
+ position: relative;
+
+ .icon {
+ position: absolute;
+ right: 30rpx;
+ bottom: 30rpx;
+ width: 160rpx;
+ height: 122rpx;
}
+
.head {
display: flex;
justify-content: space-between;
@@ -103,17 +170,12 @@
.status {
color: $primaryColor;
+ }
+ .gray{
+ color: gray;
}
}
- .line {
- display: flex;
- margin-bottom: 20rpx;
-
- .la {
- color: #666666;
- }
- }
}
.title {
@@ -123,9 +185,19 @@
margin-bottom: 30rpx;
}
- .list {
- height: calc( 100vh - 720rpx ) ;
+ .line {
+ display: flex;
+ margin-bottom: 20rpx;
+
+ .la {
+ color: #666666;
+ }
+ }
+
+ .list {
+ height: calc(100vh - 720rpx);
overflow: auto;
+
.item {
width: 690rpx;
height: 188rpx;
@@ -136,7 +208,9 @@
display: flex;
padding: 20rpx 30rpx 0 16rpx;
margin-bottom: 20rpx;
-
+ .line{
+ margin-bottom: 10rpx;
+ }
.icon {
width: 10rpx;
height: 148rpx;
@@ -160,6 +234,9 @@
offset-anchor: 28rpx;
color: $primaryColor;
font-weight: 400;
+ }
+ .gray{
+ color: #999999;
}
}
@@ -176,29 +253,31 @@
}
}
}
- .footer{
- position: fixed;
- bottom: 0rpx;
- left: 0rpx;
- width: 750rpx;
- height: 172rpx;
- background-color: #fff;
- padding: 20rpx 40rpx;
- .sub_btn {
-
- width: 670rpx;
- height: 88rpx;
- background: $primaryColor;
- box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
- border-radius: 44rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-weight: 500;
- font-size: 32rpx;
- color: #FFFFFF;
- }
+
+ .footer {
+ position: fixed;
+ bottom: 0rpx;
+ left: 0rpx;
+ width: 750rpx;
+ height: 172rpx;
+ background-color: #fff;
+ padding: 20rpx 40rpx;
+
+ .sub_btn {
+
+ width: 670rpx;
+ height: 88rpx;
+ background: $primaryColor;
+ box-shadow: 0rpx 8rpx 20rpx 0rpx rgba(0, 104, 255, 0.3);
+ border-radius: 44rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: 500;
+ font-size: 32rpx;
+ color: #FFFFFF;
+ }
}
-
+
}
</style>
\ No newline at end of file
diff --git a/h5/pages/polling/point.vue b/h5/pages/polling/point.vue
index 6a97c8a..1df5fef 100644
--- a/h5/pages/polling/point.vue
+++ b/h5/pages/polling/point.vue
@@ -2,45 +2,51 @@
<view class="main_app">
<view class="info">
<view class="head">
- <view class="">宸℃鐐�</view>
- <view class="status">宸插贰妫�</view>
+ <view class="">{{ info.pointName }}</view>
+ <view class="status" :class="{primaryColor: info.status == 0}">{{ info.status == 1 ? '宸插贰妫�' : '寰呭贰妫�' }}</view>
</view>
- <template v-if="false">
+ <template v-if="info.status == 1">
<view class="line">
<div class="la">宸℃缁撴灉锛�</div>
- <div class="val">姝e父</div>
+ <div class="val primaryColor" :class="{red: info.dealStatus == 1}">{{ info.dealStatus == 0 ? '姝e父' : '寮傚父' }}</div>
</view>
<view class="line">
<div class="la">宸℃鏃堕棿锛�</div>
- <div class="val">2022</div>
+ <div class="val">{{ info.dealDate }}</div>
</view>
</template>
<template v-else>
<view class="desc">
- 宸℃鍐呭
+ {{ info.content }}
</view>
</template>
</view>
<!-- -->
- <view v-if="false" class="content">
- <view class="title">宸℃璁板綍</view>
- <view class="desc">宸茬粡鏇存崲鐏场</view>
+ <view v-if="info.status == 1" class="content">
+ <view class="title">宸℃璁板綍</view>
+ <view class="files">
+ <view class="adduser_list_item_ipt1_upload" v-for="(item, i) in info.multifileList" :key="i">
+ <image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
+ <video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
+ </view>
+ </view>
+ <view class="desc">{{ info.dealInfo }}</view>
<view class="line line_s">
<view class="la">宸℃浜猴細</view>
- <view class="val">xxx</view>
+ <view class="val">{{ info.realname }}</view>
</view>
<view class="line line_s">
<view class="la">宸℃鏃堕棿锛�</view>
- <view class="val">xxx</view>
+ <view class="val">{{ info.dealDate }}</view>
</view>
</view>
<view v-else class="content">
<view class="title">宸℃澶勭悊</view>
<view class="appr_modal">
<view class="df_sb">
- <view>澶勭悊鏃堕棿</view>
- <view class="df_ac" @click="isShowHandleDate = true" v-if="handleParam.dealTime">
- {{ handleParam.dealTime }}
+ <view><text class="red">*</text>澶勭悊鏃堕棿</view>
+ <view class="df_ac" @click="isShowHandleDate = true" v-if="handleParam.dealDate">
+ {{ handleParam.dealDate }}
<u-icon name="arrow-right"></u-icon>
</view>
<view @click="isShowHandleDate = true" v-else class="placeholder9 df_ac">
@@ -50,7 +56,6 @@
</view>
<view class="label">
- <text>*</text>
涓婁紶鍥剧墖/瑙嗛
</view>
<view class="upload_wrap">
@@ -58,19 +63,19 @@
<u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
<view class="mt6">鍥剧墖/瑙嗛</view>
</view>
- <view class="adduser_list_item_ipt1_upload" v-for="(item, i) in dealFileList" :key="i">
+ <view class="adduser_list_item_ipt1_upload" v-for="(item, i) in fileList" :key="i">
<u-icon class="close" size="20" name="close-circle-fill" color="red"
- @click="fileDel('dealBeforeFileList', i)"></u-icon>
+ @click="fileDel('fileList', i)"></u-icon>
<image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
<video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
</view>
</view>
<view class="label">澶勭悊璇存槑</view>
- <textarea v-model="handleParam.checkInfo" placeholder="璇峰~鍐欏鐞嗚鏄�" placeholder-class="placeholder9" />
+ <textarea v-model="handleParam.dealInfo" placeholder="璇峰~鍐欏鐞嗚鏄�" placeholder-class="placeholder9" />
</view>
</view>
- <view class="sub_btn">纭宸℃</view>
+ <view class="sub_btn" @click="onSubmit">纭宸℃</view>
<!-- -->
<u-popup :show="showUpload" @close="showUpload = false" closeOnClickOverlay>
<view class="sel_upload_wrap">
@@ -86,22 +91,47 @@
<script>
import {
- uploadUrl
+ uploadUrl,
+ ywPatrolPointDetail,
+ patrolData
} from '@/api'
import dayjs from 'dayjs';
export default {
data() {
- return {
+ return {
+ id: '',
+ info: {},
showUpload: false,
isShowHandle: false,
isShowHandleDate: false,
- handleParam: {},
- dealFileList: []
+ handleParam: {
+ dealStatus: 1
+ },
+ fileList: []
};
+ },
+ onLoad(option) {
+ this.id = option.id
+ this.getDetail()
+ this.$set(this.handleParam, 'dealDate', dayjs().format('YYYY-MM-DD HH:mm:ss'))
},
methods: {
- onSubmit() {
-
+ onSubmit() {
+ const { handleParam, fileList, id } = this
+ patrolData({
+ ...handleParam,
+ multifileList: fileList,
+ id,
+ }).then(res => {
+ this.showToast('鎿嶄綔鎴愬姛')
+ uni.navigateBack()
+ })
+ },
+ getDetail(){
+ const { id } = this
+ ywPatrolPointDetail(id).then(res => {
+ this.info = res.data
+ })
},
callPhone() {
uni.makePhoneCall({
@@ -109,7 +139,7 @@
});
},
confirmHandleDate(e) {
- this.$set(this.handleParam, 'dealTime', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'));
+ this.$set(this.handleParam, 'dealDate', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'));
this.isShowHandleDate = false;
},
fileDel(str, i) {
@@ -137,7 +167,7 @@
files: imgs,
name: 'file',
formData: {
- folder: 'HIDDEN_DANGER_FILE'
+ folder: 'YW_PATROL'
},
header: {
Dm_user_token: token
@@ -149,7 +179,7 @@
i.type = 0;
i.fileurl = i.imgaddr;
i.fileurlFull = i.url;
- this.submitFileList.push(i);
+ this.fileList.push(i);
});
}
},
@@ -183,7 +213,7 @@
},
name: 'file',
formData: {
- folder: 'HIDDEN_DANGER_FILE'
+ folder: 'YW_PATROL'
},
success: uploadFileRes => {
let res = JSON.parse(uploadFileRes.data);
@@ -192,7 +222,7 @@
i.type = 1;
i.fileurl = i.imgaddr;
i.fileurlFull = i.url;
- this.submitFileList.push(i);
+ this.fileList.push(i);
});
}
},
@@ -342,37 +372,41 @@
margin-bottom: 30rpx;
}
- .adduser_list_item_ipt1_upload {
- margin-top: 24rpx;
- width: 156rpx;
- height: 156rpx;
- margin-right: 24rpx;
- border: 2rpx solid #e5e5e5;
- background: #f7f7f7;
- color: #666666;
- font-size: 22rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- position: relative;
-
- .close {
- position: absolute;
- right: -20rpx;
- top: -20rpx;
- z-index: 9999;
- }
-
- image {
- width: 100%;
- height: 100%;
- }
-
- video {
- width: 100%;
- height: 100%;
- }
- }
+ }
+ .files{
+ display: flex;
+ margin-bottom: 20rpx;
+ }
+ .adduser_list_item_ipt1_upload {
+ margin-top: 24rpx;
+ width: 156rpx;
+ height: 156rpx;
+ margin-right: 24rpx;
+ border: 2rpx solid #e5e5e5;
+ background: #f7f7f7;
+ color: #666666;
+ font-size: 22rpx;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+
+ .close {
+ position: absolute;
+ right: -20rpx;
+ top: -20rpx;
+ z-index: 9999;
+ }
+
+ image {
+ width: 100%;
+ height: 100%;
+ }
+
+ video {
+ width: 100%;
+ height: 100%;
+ }
}
</style>
\ No newline at end of file
diff --git a/h5/pages/polling/task.vue b/h5/pages/polling/task.vue
index 17f1208..ee37c83 100644
--- a/h5/pages/polling/task.vue
+++ b/h5/pages/polling/task.vue
@@ -8,11 +8,11 @@
</view> -->
<!-- -->
<view class="tabs">
- <view class="tab" :class="{active: activeTab == 0}" @click="tabsClick(0)">
+ <view class="tab" :class="{active: param.status == 0}" @click="tabsClick(0)">
<text>寰呭鐞�</text>
<text class="border"></text>
</view>
- <view class="tab" :class="{active: activeTab == 1}" @click="tabsClick(1)">
+ <view class="tab" :class="{active: param.status == 3}" @click="tabsClick(3)">
<text>宸插鐞�</text>
<text class="border"></text>
</view>
@@ -27,18 +27,22 @@
</view>
<!-- -->
<view class="list">
- <view class="item" v-for="item in 10" @click="itemClick(item)">
- <image v-if="item.stats == 1" src="@/static/side/xunjianed.png" class="icon"></image>
+ <view class="item" v-for="item in list" @click="itemClick(item)">
+ <image v-if="item.status == 0 || item.status == 1" src="@/static/side/xunjianed.png" class="icon"></image>
<image v-else src="@/static/side/xunjian.png" class="icon"></image>
<view class="content">
<view class="name_wrap line">
- <view class="name">宸℃閰掑晩</view>
- <view class="status">寰呭紑濮�</view>
+ <view class="name">{{item.planTitle}}</view>
+ <view class="status" :class="{
+ green: item.status == 1,
+ red: item.status == 2,
+ gray: item.status == 3 || item.status == 4
+ }">{{statusM[item.status]}}</view>
</view>
- <view class="line">浠诲姟鏃ユ湡锛歺xx</view>
- <view class="line">鎵ц鏃堕棿锛�121212</view>
+ <view class="line" v-if="item.startDate && item.endDate">浠诲姟鏃ユ湡锛歿{ item.startDate.slice(0, 11) }} 鑷� {{ item.endDate.slice(0, 11) }}</view>
+ <view class="line">鎵ц鏃堕棿锛歿{ item.startDate.slice(11, 16) }} - {{ item.endDate.slice(11, 16) }}</view>
<view class="line">
- <view>瀹屾垚鎯呭喌锛�121212</view>
+ <view>瀹屾垚鎯呭喌锛歿{item.finishNum}}/{{item.patrolNum}}</view>
<view class="btn">
<image src="@/static/side/ic_saoma@2x.png" class="saoma" mode=""></image>
<view>鎵爜宸℃</view>
@@ -51,29 +55,68 @@
</view>
</template>
-<script>
+<script>
+ import { ywPatrolTaskPost } from '@/api'
export default {
data() {
return {
- param: {},
+ param: {
+ status: 0
+ },
+ list: [],
activeTab: 0,
- selectAll: false
+ selectAll: false,
+ page: 1,
+
+ statusM: {
+ 0: '寰呭紑濮�',
+ 1: '杩涜涓�',
+ 2: '宸茶秴鏈�',
+ 3: '宸插畬鎴�',
+ 4: '宸插彇娑�',
+ }
};
+ },
+ onLoad() {
+ this.getList()
+ },
+ onReachBottom() {
+ const {total,list} = this
+ if (list.length < total) {
+ this.page = this.page + 1
+ this.getList()
+ } else {
+ this.showToast('鏆傛棤鏇村鏁版嵁')
+ }
},
methods: {
tabsClick(val) {
- this.activeTab = val
+ this.param.status = val
+ this.page = 1
+ this.list = []
+ this.getList()
},
allClick() {
this.selectAll = !this.selectAll
+ this.list = []
+ this.page = 1
+ this.getList()
},
- itemClick() {
+ itemClick(item) {
uni.navigateTo({
- url: '/pages/polling/detail'
+ url: '/pages/polling/detail?id=' + item.id
})
},
getList() {
- console.log('---');
+ const { page, param, selectAll } = this
+ ywPatrolTaskPost({
+ model: {...param, dispatchUserId: selectAll ? '' : uni.getStorageSync('userInfo').id, },
+ page,
+ capacity: 10
+ }).then(res => {
+ this.list = [...this.list, ...res.data.records]
+ this.total = res.data.total
+ })
}
}
}
@@ -206,6 +249,12 @@
.status{
color: $primaryColor;
}
+ .green{
+ color: #0ADE79;
+ }
+ .gray{
+ color: #999999;
+ }
}
}
}
diff --git a/h5/pages/workOrder/detail.vue b/h5/pages/workOrder/detail.vue
index a3bf40d..5d31a6c 100644
--- a/h5/pages/workOrder/detail.vue
+++ b/h5/pages/workOrder/detail.vue
@@ -100,7 +100,7 @@
</view>
<view class="adduser_list_item_ipt1_upload" v-for="(item, i) in dealFileList" :key="i">
<u-icon class="close" size="20" name="close-circle-fill" color="red"
- @click="fileDel('dealBeforeFileList', i)"></u-icon>
+ @click="fileDel('dealFileList', i)"></u-icon>
<image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
<video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
</view>
diff --git a/h5/pages/workOrder/edit.vue b/h5/pages/workOrder/edit.vue
index add269c..2fde8da 100644
--- a/h5/pages/workOrder/edit.vue
+++ b/h5/pages/workOrder/edit.vue
@@ -38,7 +38,7 @@
</view>
<view class="upload_file" v-for="(item, i) in fileList" :key="i">
<u-icon class="close" size="20" name="close-circle-fill" color="red"
- @click="fileDel('dealBeforeFileList', i)"></u-icon>
+ @click="fileDel('fileList', i)"></u-icon>
<image v-if="item.type == 0" :src="item.fileurlFull" mode="widthFix"></image>
<video v-if="item.type == 1" :src="item.fileurlFull" :controls="false"></video>
</view>
diff --git a/h5/pages/workOrder/list.vue b/h5/pages/workOrder/list.vue
index 6a87955..9189109 100644
--- a/h5/pages/workOrder/list.vue
+++ b/h5/pages/workOrder/list.vue
@@ -3,43 +3,44 @@
<view class="head_wrap">
<view class="search_wrap">
<image class="mr12 search" src="@/static/home/ic_search@2x.png" mode="widthFix"></image>
- <input v-model="param.keyword" @confirm="getList()" type="text" placeholder="鎼滅储妤煎畤/鎴块棿鍚嶇О" placeholder-class="placeholder9" />
+ <input v-model="param.roomName" @confirm="handleQuery" type="text" placeholder="鎼滅储妤煎畤/鎴块棿鍚嶇О"
+ placeholder-class="placeholder9" />
</view>
- </view>
- <!-- -->
- <view class="tabs">
- <view class="tab" :class="{active: activeTab == -1}" @click="tabsClick(-1)">
- <text>寰呭鐞�</text>
- <text class="border"></text>
- </view>
- <view class="tab" :class="{active: activeTab == 2}" @click="tabsClick(2)">
- <text>宸插鐞�</text>
- <text class="border"></text>
- </view>
- <view class="tab" @click="allClick">
- <view class="name">
- <image v-if="selectAll" class="icon" src="@/static/checked.png" mode=""></image>
- <image v-else class="icon" src="@/static/check.png" mode=""></image>
- <text>鏌ョ湅鍏ㄩ儴</text>
- </view>
- <text class="border"></text>
- </view>
+ </view>
+ <!-- -->
+ <view class="tabs">
+ <view class="tab" :class="{active: activeTab == -1}" @click="tabsClick(-1)">
+ <text>寰呭鐞�</text>
+ <text class="border"></text>
+ </view>
+ <view class="tab" :class="{active: activeTab == 2}" @click="tabsClick(2)">
+ <text>宸插鐞�</text>
+ <text class="border"></text>
+ </view>
+ <view class="tab" @click="allClick">
+ <view class="name">
+ <image v-if="selectAll" class="icon" src="@/static/checked.png" mode=""></image>
+ <image v-else class="icon" src="@/static/check.png" mode=""></image>
+ <text>鏌ョ湅鍏ㄩ儴</text>
+ </view>
+ <text class="border"></text>
+ </view>
</view>
<!-- -->
<view class="list">
<view class="item" v-for="item in list" @click="itemClick(item)">
- <image v-if="item.stats == 1" src="@/static/side/workordered.png" class="icon"></image>
+ <image v-if="item.dealStatus == 0" src="@/static/side/workordered.png" class="icon"></image>
<image v-else src="@/static/side/workorder.png" class="icon"></image>
<view class="content">
<view class="name_wrap line">
- <view class="name">{{item.buildingName}}/{{item.roomNum}}</view>
- <view class="status gray" v-if="item.dealStatus == 2">宸插鐞�</view>
- <view class="status" v-if="item.dealStatus == 0">寰呭鐞�</view>
+ <view class="name">{{item.buildingName}}/{{item.roomNum || item.floorName}}</view>
+ <view class="status gray" v-if="item.dealStatus == 2">宸插鐞�</view>
+ <view class="status" v-if="item.dealStatus == 0">寰呭鐞�</view>
<view class="status" v-if="item.dealStatus == 1">寰呭鐞�</view>
</view>
- <view class="line">浣嶇疆绫诲瀷锛歿{item.areaType == '0' ? '瀹ゅ唴瑁呬慨' : '鍏叡鍖哄煙'}}</view>
- <view class="line">宸ュ崟鍒嗙被锛歿{item.categoryName}}</view>
- <view class="line">涓婃姤鏃堕棿锛歿{item.createDate}}</view>
+ <view class="line">浣嶇疆绫诲瀷锛歿{item.areaType == '0' ? '瀹ゅ唴瑁呬慨' : '鍏叡鍖哄煙'}}</view>
+ <view class="line">宸ュ崟鍒嗙被锛歿{item.categoryName}}</view>
+ <view class="line">涓婃姤鏃堕棿锛歿{item.createDate}}</view>
<view class="line">涓婇棬鏃堕棿锛歿{item.getDate}}</view>
</view>
</view>
@@ -48,101 +49,136 @@
</view>
</template>
-<script>
- import { ywWorkorder } from '@/api'
+<script>
+ import {
+ ywWorkorder
+ } from '@/api'
export default {
data() {
return {
- param: {},
- activeTab: -1,
- selectAll: false,
-
- list: [],
- total: 0,
+ param: {},
+ activeTab: -1,
+ selectAll: false,
+
+ list: [],
+ total: 0,
page: 1,
};
- },
- onShow() {
- this.getList()
- },
- onReachBottom() {
-
+ },
+ onShow() {
+ this.getList()
+ },
+ onReachBottom() {
+ const {total,list} = this
+ if (list.length < total) {
+ this.page = this.page + 1
+ this.getList()
+ } else {
+ this.showToast('鏆傛棤鏇村鏁版嵁')
+ }
},
methods: {
- tabsClick(val) {
- this.activeTab = val
+ tabsClick(val) {
+ this.activeTab = val
+ this.list = []
+ this.page = 1
+ this, getList()
+ },
+ allClick() {
+ this.selectAll = !this.selectAll
+ this.list = []
+ this.page = 1
+ this.getList()
+ },
+ itemClick(item) {
+ uni.navigateTo({
+ url: `/pages/workOrder/detail?id=${item.id}`
+ })
+ },
+ handleQuery() {
this.list = []
this.page = 1
- this,getList()
- },
- allClick() {
- this.selectAll = !this.selectAll
- },
- itemClick(item) {
- uni.navigateTo({
- url: `/pages/workOrder/detail?id=${item.id}`
- })
- },
- getList() {
- const { page, total, list, activeTab } = this
- ywWorkorder({
- page,
- capacity: 10,
- model: { }
- }).then(res => {
- this.list = res.data.records || []
- })
+ this.getList()
+ },
+ getList() {
+ const {
+ page,
+ total,
+ list,
+ activeTab,
+ param,
+ selectAll
+ } = this
+ ywWorkorder({
+ page,
+ capacity: 10,
+ model: {
+ ...param,
+ dispatchUserId: selectAll ? '' : uni.getStorageSync('userInfo').id,
+ }
+ }).then(res => {
+ this.list = [...this.list, ...res.data.records]
+ this.total = res.data.total
+ })
}
}
}
</script>
-<style lang="scss" scoped>
- .main_app{
- padding: 0 30rpx;
- }
- .tabs{
- display: flex;
- width: 750rpx;
- margin: 12rpx -30rpx 0;
- border-bottom: 1rpx solid #E5E5E5;
- .tab{
- font-size: 30rpx;
- color: #666666;
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: flex-end;
- height: 88rpx;
- .name{
- display: flex;
- align-items: center;
- }
- .icon{
- width: 28rpx;
- height: 28rpx;
- margin-right: 10rpx;
- }
- .border{
- width: 54rpx;
- height: 6rpx;
- background-color: #fff;
- border-radius: 3rpx;
- margin-top: 24rpx;
- }
- }
- .active{
- font-weight: 600;
- font-size: 32rpx;
- color: #222222;
- .border{
- background-color: $primaryColor;
- }
-
- }
-
+<style lang="scss" scoped>
+ .main_app {
+ padding: 0 30rpx;
}
+
+ .tabs {
+ display: flex;
+ width: 750rpx;
+ margin: 12rpx -30rpx 0;
+ border-bottom: 1rpx solid #E5E5E5;
+
+ .tab {
+ font-size: 30rpx;
+ color: #666666;
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: flex-end;
+ height: 88rpx;
+
+ .name {
+ display: flex;
+ align-items: center;
+ }
+
+ .icon {
+ width: 28rpx;
+ height: 28rpx;
+ margin-right: 10rpx;
+ }
+
+ .border {
+ width: 54rpx;
+ height: 6rpx;
+ background-color: #fff;
+ border-radius: 3rpx;
+ margin-top: 24rpx;
+ }
+ }
+
+ .active {
+ font-weight: 600;
+ font-size: 32rpx;
+ color: #222222;
+
+ .border {
+ background-color: $primaryColor;
+ }
+
+ }
+
+ }
+
.head_wrap {
display: flex;
align-items: center;
@@ -155,9 +191,11 @@
background: #F7F7F7;
border-radius: 38rpx;
padding-left: 30rpx;
- input{
- flex: 1;
+
+ input {
+ flex: 1;
}
+
.search {
width: 28rpx;
height: 28rpx;
@@ -169,44 +207,51 @@
.list {
.item {
display: flex;
- // height: 290rpx;
- padding: 30rpx 0;
+ // height: 290rpx;
+ padding: 30rpx 0;
border-bottom: 2rpx solid #E5E5E5;
+
.icon {
width: 80rpx;
- height: 80rpx;
+ height: 80rpx;
margin-right: 24rpx;
}
.content {
- flex: 1;
- color: #666666;
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- .line{
- margin-bottom: 20rpx;
- &:nth-last-child(1){
- margin-bottom: 0;
- }
- }
- .name_wrap{
- display: flex;
- justify-content: space-between;
- align-items: center;
- .name{
- display: flex;
- align-items: flex-end;
- font-weight: 600;
- font-size: 34rpx;
- color: #222222;
- }
- .status{
- color: $primaryColor;
- }
- .gray{
- color: #999999;
- }
+ flex: 1;
+ color: #666666;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+
+ .line {
+ margin-bottom: 20rpx;
+
+ &:nth-last-child(1) {
+ margin-bottom: 0;
+ }
+ }
+
+ .name_wrap {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+ .name {
+ display: flex;
+ align-items: flex-end;
+ font-weight: 600;
+ font-size: 34rpx;
+ color: #222222;
+ }
+
+ .status {
+ color: $primaryColor;
+ }
+
+ .gray {
+ color: #999999;
+ }
}
}
}
--
Gitblit v1.9.3