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 |  586 ++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 405 insertions(+), 181 deletions(-)

diff --git a/pages/actionChange/agencyPage/index.vue b/pages/actionChange/agencyPage/index.vue
index a2df79f..46d84cb 100644
--- a/pages/actionChange/agencyPage/index.vue
+++ b/pages/actionChange/agencyPage/index.vue
@@ -3,39 +3,39 @@
 		<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="">
-			<view
-				:key="index"
-				v-for="(item, index) in workOderList"
-				class="workOrderDetail"
-				@tap="handleClick(item, 'edit')"
-			>
+		<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="">
-							������������:
-							<span>{{ item.allocationNum }}</span>
+						<text class=" titleLable"> ������������: {{ item.allocationNum }}
 						</text>
 						<text class="rowTipContenet_right">
-							<text catchtap class="butsName" @tap.stop="handleClick(item, 'view')">
-								������
-							</text>
-							<text
-								catchtap
-								class="butsName"
-								@tap.stop="handleClick(item, 'edit')"
-							>
+							<text catchtap class="butsName" @tap.stop="handleClick(item, 'view')"> ������ </text>
+							<text catchtap class="butsName" @tap.stop="handleClick(item, 'edit')">
 								{{ item.stateName }}
 							</text>
 						</text>
@@ -48,8 +48,7 @@
 							<view class="wholeLine">
 								<text class="rowTipContenetLabel">������������:</text>
 								<text class="rowTipContenetAll">
-									{{
-										unitList.find(
+									{{ unitList.find(
 											(a) => item && parseInt(a.unitId) === item.unitId
 										).unitName
 									}}
@@ -60,8 +59,7 @@
 							<view class="wholeLine">
 								<text class="rowTipContenetLabel">������������:</text>
 								<text class="rowTipContenetAll">
-									{{
-										polluteList.find(
+									{{ polluteList.find(
 											(a) => item && parseInt(a.dataKey) === item.polluteType
 										).dataValue
 									}}
@@ -83,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>
@@ -104,12 +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>
@@ -123,170 +121,396 @@
 						</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>
-
 <script>
-import { httpPost, httpGet } from '@/utils/http.js'
-export default {
-	comments: {},
-	data() {
-		return {
-			scrollable: false,
-			userInfor: this.$storage.getJson('userInfo'),
-			dictObj: this.$storage.getJson('dictObj'),
-			list: [
-				{
+	import {
+		httpPost,
+		httpGet
+	} from '@/utils/http.js'
+	import store from '@/store/index.js'
+	export default {
+		data() {
+			return {
+				range: [],
+				scrollable: false,
+				userInfor: null,
+				dictObj: [],
+				list: [{
 					name: '������',
 					value: 0,
-				},
-				{
+				}, {
 					name: '���������',
 					value: 1,
-				},
-				{
+				}, {
 					name: '���������',
 					value: 2,
-				},
-				{
+				}, {
 					name: '���������',
 					value: 3,
-				},
-			],
-			current: 0,
-			workOderList: [],
-			unitList: [],
-			polluteList: [],
-		}
-	},
-	mounted() {
-		this.getWorkOrder()
-	},
-	created() {
-		this.getContaminateList()
-		this.getUnitList()
-	},
-	onShow() {
-		uni.showTabBar()
-	},
-	methods: {
-		changeTap(data) {
-			this.current = data.value
-			this.getWorkOrder()
-		},
-		// ������������������list
-		getUnitList() {
-			this.$http.httpGet('/allocation/unit').then((res)=> {
-				this.unitList = res.data
-				this.$storage.setJson('unitList', this.unitList)
-			})
-		},
-		getContaminateList() {
-			this.$http.httpGet('/allocation/contaminate').then((res)=> {
-				this.polluteList = res.data
-				this.$storage.setJson('polluteList', this.polluteList)
-			})
-		},
-		stateFormatter(val) {
-			return this.dictObj.allocationApproveEnum[val]
-		},
-		getWorkOrder() {
-			httpGet('/allocationApp/select', {
-				state: this.current,
+				}, ],
+				showeEscalationTime: false,
+				current: 1,
 				startTime: '',
 				endTime: '',
-			}).then((res)=> {
-				this.workOderList = res.data
-			})
+				workOderList: [],
+				unitList: [],
+				polluteList: [],
+				avatarUrl: '',
+				baseUrl: '',
+				token: '',
+				status: 'loadmore',
+				loadingText: '���������������',
+				loadmoreText: '������������',
+				nomoreText: '���������������',
+				isLoading: false,
+				page: {
+					currentPage: 1,
+					pageSize: 10
+				}
+			}
 		},
-		handleClick(e, pageState) {
-			this.$http.httpGet('/allocation/detail', { id: e.allocationId }).then((res)=> {
-				let data =res.data
-				data.pageState =pageState
+		watch: {
+			range(newval) {
+				console.log('newval', newval)
+				this.startTime = newval[0]
+				this.endTime = newval[1]
+			},
+		},
+		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
+			}
+		},
+		mounted() {},
+		filters: {
+			stateFormatter(val) {
+				let information = JSON.parse(uni.getStorageSync('dictObj') || '[]')
+				return information.allocationApproveEnum[val]
+			}
+		},
+		onLoad: () => {},
+		methods: {
+			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
+				})
+			},
+			getContaminateList() {
+				console.log('indexindex')
+				this.$http.httpGet('/allocation/contaminate').then(res => {
+					this.polluteList = res.data
+					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()
+				})
+			},
+			getWorkOrder() {
+				httpPost('/allocationApp/page', {
+					state: this.current,
+					startTime: this.startTime,
+					endTime: this.endTime,
+					page: {
+						'currentPage': this.page.currentPage,
+						'pageSize': this.page.pageSize
+					},
+				}).then(res => {
+					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) {
+				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,
-		      })
-			})
+				uni.navigateTo({
+					url: '/pages/actionChange/workOrderDetails/index?infor=' + myData + '&type=jump',
+				})
+			},
 		},
-
-	},
-	// onShow() {},
-}
+		// onShow() {},
+	}
 </script>
-
 <style scoped lang="scss">
-/deep/.uni-page-head {
-  display: none;
-}
-.hearderInfor {
-  font-size: 26.92rpx;
-  height: 223.08rpx;
-  background-color: #3875c5;
-  color: #f2f2f2;
-  .unit {
-    text-align: right;
-    padding-right: 19.23rpx;
-    padding-top: 19.23rpx;
-  }
-  .headSculpture {
-    display: flex;
-    align-items: center;
-    image {
-      height: 117.31rpx;
-      width: 117.31rpx;
-      margin: 0rpx 46.15rpx;
-    }
-  }
-}
-.textContent {
-  text-align: left;
-  width: 100%;
-  font-size: 28.85rpx;
-}
-.workOrderDetail {
-  border: 1px solid #bbb;
-  border-radius: 5px;
-  min-height: 288.46rpx;
-  margin: 19.23rpx;
-  padding: 19.23rpx;
-  color: #101010;
-  font-weight: 700;
-  font-size: 26.92rpx;
-  /deep/.u-line {
-    margin: 19.23rpx 0px !important;
-  }
+	page {
+		height: 101vh;
+	}
 
-  .mainContent {
-    margin-bottom: 10px;
-    .rowTip {
-      display: flex;
-      .wholeLine {
-        display: flex;
-        .rowTipContenetLabel {
-          min-width: 125rpx;
-        }
-      }
-      .rowTipContenetAll {
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-      }
-      .rowTipContenet {
-        width: 50%;
-        text-align: left;
-      }
-    }
-    .butsName {
-      display: inline-block;
-      margin-left: 19.23rpx;
-      color: #1990ff;
-    }
-    .rowTipContenet_right {
-      text-align: right !important;
-    }
-  }
-}
-</style>
+	/deep/.uni-page-head {
+		display: none;
+	}
+
+	.hearderInfor {
+		font-size: 28.85rpx;
+		background-color: #3875c5;
+		padding-bottom: 8px;
+		color: #f2f2f2;
+
+		.unit {
+			text-align: right;
+			padding-right: 19.23rpx;
+			padding-top: 19.23rpx;
+		}
+
+		.headSculpture {
+			display: flex;
+			align-items: center;
+			padding-left: 20px;
+
+			.imageSrc {
+				height: 117.31rpx;
+				width: 117.31rpx;
+				margin: 0rpx 46.15rpx;
+			}
+		}
+	}
+
+	.textContent {
+		text-align: left;
+		width: 100%;
+		font-size: 30.77rpx;
+	}
+
+	.workOrderDetail {
+		border: 1px solid #bbb;
+		border-radius: 5px;
+		margin: 9.62rpx;
+		padding: 9.62rpx 19.23rpx;
+		color: #101010;
+		font-size: 30.77rpx;
+
+		/deep/.u-line {
+			margin: 9.62rpx 0px !important;
+		}
+
+		.mainContent {
+			margin-bottom: 5px;
+
+			.rowTip {
+				display: flex;
+
+				.wholeLine {
+					display: flex;
+
+					.rowTipContenetLabel {
+						min-width: 125rpx;
+					}
+				}
+
+				.rowTipContenetAll {
+					overflow: hidden;
+					text-overflow: ellipsis;
+					white-space: nowrap;
+				}
+
+				.rowTipContenet {
+					width: 50%;
+					text-align: left;
+				}
+			}
+
+			.butsName {
+				display: inline-block;
+				margin-left: 19.23rpx;
+				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