From d8b41fff43a2cee6a8f714ffa807623b15803786 Mon Sep 17 00:00:00 2001 From: quanyawei <401863037@qq.com> Date: Fri, 20 Oct 2023 15:21:35 +0800 Subject: [PATCH] fix:立行立改Uniapp小程序新建项目 --- pages/actionChange/agencyPage/index.vue | 345 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 172 insertions(+), 173 deletions(-) diff --git a/pages/actionChange/agencyPage/index.vue b/pages/actionChange/agencyPage/index.vue index a2df79f..5c535ca 100644 --- a/pages/actionChange/agencyPage/index.vue +++ b/pages/actionChange/agencyPage/index.vue @@ -3,39 +3,27 @@ <view class="hearderInfor"> <view> <p class="unit"> - <text>���������������{{ userInfor.userName }}</text> + <text>���������������{{ userInfor.userName ||''}}</text> </p> </view> <view class="headSculpture"> <image alt="" src="/static/img/headSculpture.png" /> - <text>������������{{ userInfor.userName }}</text> + <text>������������{{ userInfor.userName || ''}}</text> </view> </view> <view> <u-tabs :list="list" :scrollable="scrollable" @change="changeTap" /> </view> - <view class=""> - <view - :key="index" - v-for="(item, index) in workOderList" - class="workOrderDetail" - @tap="handleClick(item, 'edit')" - > + <view class="" v-if="userInfor.userName"> + <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=""> ������������: {{ 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 +36,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 +47,7 @@ <view class="wholeLine"> <text class="rowTipContenetLabel">������������:</text> <text class="rowTipContenetAll"> - {{ - polluteList.find( + {{ polluteList.find( (a) => item && parseInt(a.dataKey) === item.polluteType ).dataValue }} @@ -104,8 +90,7 @@ <view class="wholeLine"> <text class="rowTipContenetLabel">������������:</text> <text class="rowTipContenetAll"> - {{ - unitList.find( + {{ unitList.find( (a) => item && parseInt(a.unitId) === item.escalationUnitId ).unitName @@ -127,166 +112,180 @@ </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' + export default { + data() { + return { + scrollable: false, + userInfor: {}, + 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 + }, ], + current: 0, + workOderList: [], + unitList: [], + polluteList: [], + } + }, + mounted() { + console.log('mounted this.userInfo', this.userInfo) + }, + created() { + console.log('created this.userInfo', this.userInfo) + this.getContaminateList() + this.getUnitList() this.getWorkOrder() }, - // ������������������list - getUnitList() { - this.$http.httpGet('/allocation/unit').then((res)=> { - this.unitList = res.data - this.$storage.setJson('unitList', this.unitList) - }) + onShow() { + uni.showTabBar() }, - getContaminateList() { - this.$http.httpGet('/allocation/contaminate').then((res)=> { - this.polluteList = res.data - this.$storage.setJson('polluteList', this.polluteList) - }) + methods: { + changeTap(data) { + this.current = data.value + this.getWorkOrder() + }, + // ������������������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() { + 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, + startTime: '', + endTime: '', + }).then(res => { + this.workOderList = res.data + }) + }, + 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, + }) + }) + }, }, - stateFormatter(val) { - return this.dictObj.allocationApproveEnum[val] - }, - getWorkOrder() { - httpGet('/allocationApp/select', { - state: this.current, - startTime: '', - endTime: '', - }).then((res)=> { - this.workOderList = res.data - }) - }, - 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, - }) - }) - }, - - }, - // 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; - } + /deep/.uni-page-head { + display: none; + } - .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> + .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; + } + + .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> \ No newline at end of file -- Gitblit v1.8.0