From 1e61215b48e59e94c1ed98e4ef956227d689d6bc Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 06 Nov 2023 08:48:39 +0800
Subject: [PATCH] fix:小程序订阅消息
---
pages/actionChange/agencyPage/index.vue | 505 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 505 insertions(+), 0 deletions(-)
diff --git a/pages/actionChange/agencyPage/index.vue b/pages/actionChange/agencyPage/index.vue
new file mode 100644
index 0000000..0d8b9fd
--- /dev/null
+++ b/pages/actionChange/agencyPage/index.vue
@@ -0,0 +1,505 @@
+<template>
+ <view>
+ <view class="hearderInfor">
+ <view>
+ <p class="unit">
+ <text>���������������{{ unitName }}</text>
+ </p>
+ </view>
+ <view class="headSculpture">
+ <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" lineWidth="60" :current='current' @change="changeTap" />
+ </view>
+ <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="getWorkOrder"></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=" 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')">
+ {{ item.stateName }}
+ </text>
+ </text>
+ </p>
+ </view>
+ <u-line color="#bbb" />
+ <view class="mainContent">
+ <p class="rowTip">
+ <view class="rowTipContenet">
+ <view class="wholeLine">
+ <text class="rowTipContenetLabel">������������:</text>
+ <text class="rowTipContenetAll">
+ {{ unitList.find(
+ (a) => item && parseInt(a.unitId) === item.unitId
+ ).unitName
+ }}
+ </text>
+ </view>
+ </view>
+ <view class="rowTipContenet">
+ <view class="wholeLine">
+ <text class="rowTipContenetLabel">������������:</text>
+ <text class="rowTipContenetAll">
+ {{ polluteList.find(
+ (a) => item && parseInt(a.dataKey) === item.polluteType
+ ).dataValue
+ }}
+ </text>
+ </view>
+ </view>
+ </p>
+ </view>
+ <view class="mainContent">
+ <p class="rowTip">
+ <view class="rowTipContenet">
+ <view class="wholeLine">
+ <text class="rowTipContenetLabel">������������:</text>
+ <text class="rowTipContenetAll">
+ {{ dictObj.changeEnum[item.changeType] }}
+ </text>
+ </view>
+ </view>
+ <view class="rowTipContenet">
+ <view class="wholeLine">
+ <text class="rowTipContenetLabel">������������:</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>
+ </view>
+ <view class="mainContent">
+ <p class="rowTip">
+ <view class="rowTipContenet">
+ <view class="wholeLine">
+ <text class="rowTipContenetLabel">������������:</text>
+ <text class="rowTipContenetAll">
+ {{ item.escalationTime }}
+ </text>
+ </view>
+ </view>
+ <view class="rowTipContenet">
+ <view class="wholeLine">
+ <text class="rowTipContenetLabel">������������:</text>
+ <text class="rowTipContenetAll">
+ {{ unitList.find(
+ (a) =>
+ item && parseInt(a.unitId) === item.escalationUnitId
+ ).unitName
+ }}
+ </text>
+ </view>
+ </view>
+ </p>
+ </view>
+ <view class="mainContent">
+ <p class="rowTip">
+ <view class="wholeLine">
+ <text class="rowTipContenetLabel">������������:</text>
+ <text class="rowTipContenetAll">{{ item.pollutePosition }}</text>
+ </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'
+ 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,
+ }, ],
+ showeEscalationTime: false,
+ current: 1,
+ startTime: '',
+ endTime: '',
+ workOderList: [],
+ unitList: [],
+ polluteList: [],
+ avatarUrl: '',
+ baseUrl: '',
+ token: '',
+ status: 'loadmore',
+ loadingText: '���������������',
+ loadmoreText: '������������',
+ nomoreText: '���������������',
+ isLoading: false,
+ page: {
+ currentPage: 1,
+ pageSize: 10
+ }
+ }
+ },
+ 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
+ }
+ },
+ onReachBottom() {
+ //������������������������������������������
+ if (this.isLoading) {
+ this.status = 'loading'
+ //������������������,���������++
+ this.page.currentPage = ++this.page.currentPage
+ //������������,������������tab������������
+ this.getWorkOrder()
+ }
+ },
+ mounted() {},
+ filters: {
+ stateFormatter(val) {
+ let information = JSON.parse(uni.getStorageSync('dictObj') || '[]')
+ return information.allocationApproveEnum[val]
+ }
+ },
+ onLoad: () => {},
+ methods: {
+ getLoadmore() {
+ if (this.isLoading) {
+ 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.startTime = ''
+ this.endTime = ''
+ this.getWorkOrder()
+ },
+ // ������������������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'
+ }
+ if (this.page.currentPage === res.data.page.currentPage) {
+ this.workOderList = res.data.list
+ } else {
+ 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 = e.stateName === '���������' ? pageState : 'view'
+ let myData = JSON.stringify(data)
+ uni.navigateTo({
+ url: '/pages/actionChange/workOrderDetails/index?infor=' + myData + '&type=jump',
+ })
+ })
+ },
+ },
+ // onShow() {},
+ }
+</script>
+<style scoped lang="scss">
+ /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: 0;
+ transform: rotate(-2deg) scale(5);
+ 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