quanyawei
2023-10-20 d8b41fff43a2cee6a8f714ffa807623b15803786
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>