From 5f8cd55f32939d15c6224d491f89743421cab0f9 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 20 Nov 2023 13:12:42 +0800
Subject: [PATCH] fix:分享修改

---
 pages/actionChange/agencyPage/index.vue |  341 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 283 insertions(+), 58 deletions(-)

diff --git a/pages/actionChange/agencyPage/index.vue b/pages/actionChange/agencyPage/index.vue
index 5c535ca..46d84cb 100644
--- a/pages/actionChange/agencyPage/index.vue
+++ b/pages/actionChange/agencyPage/index.vue
@@ -3,23 +3,35 @@
 		<view class="hearderInfor">
 			<view>
 				<p class="unit">
-					<text>���������������{{ userInfor.userName ||''}}</text>
+					<text>���������������{{ unitName }}</text>
 				</p>
 			</view>
 			<view class="headSculpture">
-				<image alt="" src="/static/img/headSculpture.png" />
-				<text>������������{{ userInfor.userName || ''}}</text>
+				<button open-type="chooseAvatar" @chooseavatar='onChooseAvatar'
+					style="padding: 0;margin: 0;border-radius: 100px;">
+					<u-avatar :src="avatarUrl" randomBgColor size='60'></u-avatar>
+				</button>
+				<text style="margin-left: 46.15rpx;">������������{{ userName || ''}}</text>
 			</view>
 		</view>
 		<view>
-			<u-tabs :list="list" :scrollable="scrollable" @change="changeTap" />
+			<u-tabs :list="list" :scrollable="scrollable" lineWidth="60" :current='current' @change="changeTap" />
 		</view>
-		<view class="" v-if="userInfor.userName">
+		<view class="" v-if="userName">
+			<view class="dataRangeSerch" v-if="current===3">
+				<view class="dataRangeSerchLabel">
+					<text style="margin-right: 8px;">������:</text>
+					<uni-datetime-picker v-model="range" type="daterange" rangeSeparator="���" />
+				</view>
+				<view>
+					<u-button type="primary" size="small" text="������" @click="getSearch" throttleTime='500'></u-button>
+				</view>
+			</view>
 			<view :key="index" v-for="(item, index) in workOderList" class="workOrderDetail"
 				@tap="handleClick(item, 'edit')">
 				<view class="mainContent">
 					<p class="rowTip" style="justify-content: space-between">
-						<text class=""> ������������: {{ item.allocationNum }}
+						<text class=" titleLable"> ������������: {{ item.allocationNum }}
 						</text>
 						<text class="rowTipContenet_right">
 							<text catchtap class="butsName" @tap.stop="handleClick(item, 'view')"> ������ </text>
@@ -69,9 +81,14 @@
 						<view class="rowTipContenet">
 							<view class="wholeLine">
 								<text class="rowTipContenetLabel">������������:</text>
-								<text class="rowTipContenetAll">
-									{{ stateFormatter(item.state) }}
-								</text>
+								<u--text type="warning" :text="item.state |stateFormatter" size='30.77rpx'
+									v-if="item.state===20 ||item.state===9"></u--text>
+								<u--text type="primary" :text="item.state |stateFormatter" size='30.77rpx'
+									v-if="item.state===30"></u--text>
+								<u--text type="success" :text="item.state |stateFormatter" size='30.77rpx'
+									v-if="item.state===40"></u--text>
+								<u--text type="error" :text="item.state |stateFormatter" size='30.77rpx'
+									v-if="item.state===50"></u--text>
 							</view>
 						</view>
 					</p>
@@ -90,11 +107,7 @@
 							<view class="wholeLine">
 								<text class="rowTipContenetLabel">������������:</text>
 								<text class="rowTipContenetAll">
-									{{ unitList.find(
-											(a) =>
-												item && parseInt(a.unitId) === item.escalationUnitId
-										).unitName
-									}}
+									{{ item.escalationUnitName}}
 								</text>
 							</view>
 						</view>
@@ -108,7 +121,12 @@
 						</view>
 					</p>
 				</view>
+				<view class="yingzhang" v-if="item.isInvalid===1">
+					<view class="seal-red"> ��������� </view>
+				</view>
 			</view>
+			<u-loadmore :status="status" :loading-text="loadingText" @loadmore='getLoadmore'
+				:loadmore-text="loadmoreText" dashed line :nomore-text="nomoreText" />
 		</view>
 	</view>
 </template>
@@ -117,11 +135,13 @@
 		httpPost,
 		httpGet
 	} from '@/utils/http.js'
+	import store from '@/store/index.js'
 	export default {
 		data() {
 			return {
+				range: [],
 				scrollable: false,
-				userInfor: {},
+				userInfor: null,
 				dictObj: [],
 				list: [{
 					name: '������',
@@ -136,66 +156,211 @@
 					name: '���������',
 					value: 3,
 				}, ],
-				current: 0,
+				showeEscalationTime: false,
+				current: 1,
+				startTime: '',
+				endTime: '',
 				workOderList: [],
 				unitList: [],
 				polluteList: [],
+				avatarUrl: '',
+				baseUrl: '',
+				token: '',
+				status: 'loadmore',
+				loadingText: '���������������',
+				loadmoreText: '������������',
+				nomoreText: '���������������',
+				isLoading: false,
+				page: {
+					currentPage: 1,
+					pageSize: 10
+				}
 			}
 		},
-		mounted() {
-			console.log('mounted this.userInfo', this.userInfo)
+		watch: {
+			range(newval) {
+				console.log('newval', newval)
+				this.startTime = newval[0]
+				this.endTime = newval[1]
+			},
 		},
-		created() {
-			console.log('created this.userInfo', this.userInfo)
-			this.getContaminateList()
-			this.getUnitList()
-			this.getWorkOrder()
+		computed: {
+			unitName() {
+				let data = ''
+				if (this.userInfor && this.unitList.length > 0) {
+					data = this.unitList && this.unitList.find(a => Number(a.unitId) === Number(this.userInfor.unitId))
+				}
+				if (this.userInfor) {
+					data = this.userInfor.unName
+				}
+				return data
+			},
+			userName() {
+				let data = ''
+				if (this.userInfor) {
+					data = this.userInfor.userName
+				}
+				return data
+			}
 		},
-		onShow() {
-			uni.showTabBar()
+		mounted() {},
+		filters: {
+			stateFormatter(val) {
+				let information = JSON.parse(uni.getStorageSync('dictObj') || '[]')
+				return information.allocationApproveEnum[val]
+			}
 		},
+		onLoad: () => {},
 		methods: {
-			changeTap(data) {
-				this.current = data.value
+			onBottom() {
+				//������������������������������������������
+				console.log('1122111')
+				this.status = 'loading'
+				//������������������,���������++
+				this.page.currentPage = ++this.page.currentPage
+				//������������,������������tab������������
 				this.getWorkOrder()
+			},
+			getLoadmore() {
+				this.status = 'loading'
+				//������������������,���������++
+				this.page.currentPage = ++this.page.currentPage
+				//������������,������������tab������������
+				this.getWorkOrder()
+			},
+			async onChooseAvatar(e) {
+				const {
+					avatarUrl
+				} = e.detail // ������������������������������������������������������������������������
+				this.avatarUrl = avatarUrl
+				uni.showToast({
+					title: '������',
+					duration: 1000
+				})
+				let a = uni.uploadFile({
+					url: this.baseUrl + '/file/upload',
+					filePath: this.avatarUrl,
+					header: {
+						token: this.token,
+						Authorization: this.token,
+					},
+					name: 'file',
+					formData: {
+						sysCode: '1202401'
+					},
+					success: res => {
+						let resData = JSON.parse(res.data)
+						let parms = {
+							'file': resData.data,
+							'userId': this.userInfor.userId
+						}
+						this.$http.httpPost('/allocationApp/appFile', parms).then(res => {
+							uni.removeStorageSync('userInfor')
+							this.userInfor.file = resData.data
+							console.log('resData.data', resData.data)
+							uni.setStorageSync('userInfor', JSON.stringify(this.userInfor))
+							console.log('this.userInforSet', this.userInfor)
+						})
+						console.log(this.url)
+					},
+					fail: res => {
+						uni.showToast({
+							title: res.data,
+							icon: 'none',
+						})
+					}
+				})
+			},
+			changeTap(data) {
+				console.log(data)
+				this.current = data.value
+				this.page = {
+					currentPage: 1,
+					pageSize: 10
+				}
+				this.workOderList = []
+				this.startTime = ''
+				this.endTime = ''
+				uni.$u.throttle(this.getWorkOrder, 500)
+			},
+			getSearch() {
+				this.workOderList = []
+				this.page = {
+					currentPage: 1,
+					pageSize: 10
+				}
+				this.getWorkOrder()
+			},
+			setData() {
+				this.workOderList = []
+				this.page = {
+					currentPage: 1,
+					pageSize: 10
+				}
+				this.getContaminateList()
 			},
 			// ������������������list
 			getUnitList() {
 				this.$http.httpGet('/allocation/unit').then(res => {
 					this.unitList = res.data
-					this.userInfor = this.$storage.getJson('userInfo')
-					this.dictObj = this.$storage.getJson('dictObj')
-					this.$storage.setJson('unitList', this.unitList)
 				})
 			},
 			getContaminateList() {
+				console.log('indexindex')
 				this.$http.httpGet('/allocation/contaminate').then(res => {
 					this.polluteList = res.data
-					this.$storage.setJson('polluteList', this.polluteList)
+					this.dictObj = JSON.parse(uni.getStorageSync('dictObj') || '[]')
+					this.userInfor = JSON.parse(uni.getStorageSync('userInfor') || '{}')
+					this.baseUrl = this.$storage.get('baseUrl')
+					this.token = uni.getStorageSync('tonken')
+					this.avatarUrl = `${this.baseUrl}/file/preview/${this.userInfor.file.fileId}`
+					console.log('indexindexindexindexthis.userInfor', this.userInfor)
+					this.getUnitList()
+					this.getWorkOrder()
+				}).catch(res => {
+					console.log('���������', res)
+					// this.getContaminateList()
 				})
 			},
-			stateFormatter(val) {
-				return this.dictObj.allocationApproveEnum[val]
-			},
 			getWorkOrder() {
-				httpGet('/allocationApp/select', {
+				httpPost('/allocationApp/page', {
 					state: this.current,
-					startTime: '',
-					endTime: '',
+					startTime: this.startTime,
+					endTime: this.endTime,
+					page: {
+						'currentPage': this.page.currentPage,
+						'pageSize': this.page.pageSize
+					},
 				}).then(res => {
-					this.workOderList = res.data
+					console.log('indexindex', res.data.list)
+					if (res.data.list) {
+						if (res.data.list.length < this.page.pageSize) {
+							//���������������false������������������������,������������������������������������������
+							this.isLoading = false
+							this.status = 'nomore'
+						} else {
+							this.isLoading = true
+							this.status = 'loadmore'
+						}
+						res.data.list.forEach(el => {
+							this.workOderList.push(el)
+						})
+					} else {
+						this.status = 'nomore'
+					}
 				})
 			},
 			handleClick(e, pageState) {
-				this.$http.httpGet('/allocation/detail', {
-					id: e.allocationId
-				}).then(res => {
-					let data = res.data
-					data.pageState = pageState
-					let myData = JSON.stringify(data)
-					uni.navigateTo({
-						url: '/pages/actionChange/workOrderDetails/index?infor=' + myData,
-					})
+				let data = {}
+				data.pageState = e.stateName === '���������' ? pageState : 'view'
+				data.stateName = e.stateName
+				data.allocationId = e.allocationId
+				data.state = e.state
+				data.allocationNum = e.allocationNum
+				data.current = this.current
+				let myData = JSON.stringify(data)
+				uni.navigateTo({
+					url: '/pages/actionChange/workOrderDetails/index?infor=' + myData + '&type=jump',
 				})
 			},
 		},
@@ -203,14 +368,18 @@
 	}
 </script>
 <style scoped lang="scss">
+	page {
+		height: 101vh;
+	}
+
 	/deep/.uni-page-head {
 		display: none;
 	}
 
 	.hearderInfor {
-		font-size: 26.92rpx;
-		height: 223.08rpx;
+		font-size: 28.85rpx;
 		background-color: #3875c5;
+		padding-bottom: 8px;
 		color: #f2f2f2;
 
 		.unit {
@@ -222,8 +391,9 @@
 		.headSculpture {
 			display: flex;
 			align-items: center;
+			padding-left: 20px;
 
-			image {
+			.imageSrc {
 				height: 117.31rpx;
 				width: 117.31rpx;
 				margin: 0rpx 46.15rpx;
@@ -234,25 +404,23 @@
 	.textContent {
 		text-align: left;
 		width: 100%;
-		font-size: 28.85rpx;
+		font-size: 30.77rpx;
 	}
 
 	.workOrderDetail {
 		border: 1px solid #bbb;
 		border-radius: 5px;
-		min-height: 288.46rpx;
-		margin: 19.23rpx;
-		padding: 19.23rpx;
+		margin: 9.62rpx;
+		padding: 9.62rpx 19.23rpx;
 		color: #101010;
-		font-weight: 700;
-		font-size: 26.92rpx;
+		font-size: 30.77rpx;
 
 		/deep/.u-line {
-			margin: 19.23rpx 0px !important;
+			margin: 9.62rpx 0px !important;
 		}
 
 		.mainContent {
-			margin-bottom: 10px;
+			margin-bottom: 5px;
 
 			.rowTip {
 				display: flex;
@@ -283,9 +451,66 @@
 				color: #1990ff;
 			}
 
+			.titleLable {
+				font-size: 30.77rpx;
+				font-weight: bold;
+			}
+
 			.rowTipContenet_right {
 				text-align: right !important;
 			}
 		}
 	}
+
+	/deep/.u-tabs__wrapper__nav__item__text {
+		font-size: 34.62rpx !important;
+	}
+
+	.yingzhang {
+		position: relative;
+
+		.seal-red {
+			position: absolute;
+			right: 0;
+			top: -85px;
+			display: inline-block;
+			border: solid 2px #e93e00;
+			border-radius: .2em;
+			color: #e24c06;
+			font-size: 19px;
+			line-height: 1;
+			opacity: 0;
+			padding: .1em .5em;
+			text-transform: uppercase;
+			opacity: .75;
+			transform: rotate(-15deg) scale(1);
+			// animation: seal .3s cubic-bezier(0.6, 0.04, 0.98, 0.335) forwards;
+		}
+
+		@keyframes seal {
+			100% {
+				opacity: .75;
+				transform: rotate(-15deg) scale(1);
+			}
+		}
+	}
+
+	.dataRangeSerch {
+		display: flex;
+		justify-content: space-around;
+		align-items: center;
+		padding: 10px 0 5px 0px;
+
+		.dataRangeSerchLabel {
+			display: flex;
+			align-items: center;
+			width: 75%;
+		}
+
+		/deep/.range-separator,
+		/deep/.uni-date__x-inpu {
+			height: 30px !important;
+			line-height: 30px !important;
+		}
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.8.0