New file |
| | |
| | | <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="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=" 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"> |
| | | {{ item.escalationUnitName}} |
| | | </text> |
| | | </view> |
| | | </view> |
| | | </p> |
| | | </view> |
| | | <view class="mainContent"> |
| | | <p class="rowTip"> |
| | | <view class="wholeLine"> |
| | | <text class="rowTipContenetLabel">污染位置:</text> |
| | | <u--text class="rowTipContenetAll" :lines="1" :text="item.pollutePosition"></u--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 |
| | | } |
| | | }, |
| | | 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 + '&type=jump', |
| | | }) |
| | | }, |
| | | }, |
| | | // onShow() {}, |
| | | } |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | page { |
| | | height: 101vh; |
| | | } |
| | | |
| | | /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> |