123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- <template>
- <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
- <cus-header title='工单待办'></cus-header>
- <div class="tab">
- <div class="pre" :class="{'active':tIdx===0}" @tap="changeType(0)">待指派</div>
- <div class="pre" :class="{'active':tIdx===1}" @tap="changeType(1)">已指派(待维修)</div>
- <div class="pre" :class="{'active':tIdx===2}" @tap="changeType(2)">已维修</div>
- </div>
- <div class="boxs" v-if="list.length">
- <div class="box" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
- <div class="place">{{item.place}}</div>
- <div class="pre">报修类型<span>{{item.typename}}</span></div>
- <div class="pre">报修时间<span>{{item.time}}</span></div>
- <div class="type" :class="colorCfg[item.type]||'mr'">{{typeCfg[item.type]||'未知'}}</div>
- </div>
- </div>
- <template v-else>
- <page-empty :height="'calc(100vh - 100px)'"></page-empty>
- </template>
- </view>
- </template>
- <script>
- import pageEmpty from '@/components/pageEmpty/index.vue'
- export default {
- components:{
- pageEmpty
- },
- data(){
- return {
- typeCfg:{
- 1:'普通',
- 2:'紧急',
- 3:'非常紧急'
- },
- colorCfg:{
- 1:'pt',
- 2:'jj',
- 3:'fcjj'
- },
- tIdx:0,
- source:[
- {
- place:'B座13楼1301',
- typename:'水龙头漏水',
- time:'2024-12-28 10:32:35',
- type:3,//1普通 2紧急 3非常紧急
- status:1//1待指派 2已指派待维修 3已维修
- },
- {
- place:'B座13楼1301',
- typename:'水龙头漏水',
- time:'2024-12-28 10:32:35',
- type:2,//1普通 2紧急 3非常紧急
- status:2//1待指派 2已指派待维修 3已维修
- },
- {
- place:'B座13楼1301',
- typename:'水龙头漏水',
- time:'2024-12-28 10:32:35',
- type:1,//1普通 2紧急 3非常紧急
- status:3//1待指派 2已指派待维修 3已维修
- }
- ],
- list:[]
- }
- },
- onShow() {
- let pages = getCurrentPages();
- let last = pages[pages.length-1];
- let status = last.options?.status;
- this.tIdx = status ? (status-1) : 0;
- this.list = this.source.filter(l=>l.status==(status||1))
- },
- methods:{
- changeType(type){
- this.tIdx = type;
- this.list = this.source.filter(l=>l.status===(type+1))
- },
- toDetail(item){
- uni.navigateTo({
- url:'/pagesInspection/waitOrder/detail?order='+JSON.stringify(item)
- })
- }
- }
- }
- </script>
- <style scoped lang="less">
- .page{
- background: #F4F8FB;
- padding-bottom: 20rpx;
- box-sizing: border-box;
- .tab{
- width: 100%;
- height: 102rpx;
- background: #FFFFFF;
- display: flex;
- .pre{
- width: calc(100% / 3);
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 28rpx;
- color: #1D2129;
- line-height: 40rpx;
- position: relative;
- &.active{
- font-weight: bold;
- font-size: 32rpx;
- color: #198CFF;
- line-height: 45rpx;
- &::after{
- content: '';
- width: 36rpx;
- height: 8rpx;
- background: #198CFF;
- border-radius: 4rpx;
- position: absolute;
- left: 50%;
- margin-left: -18rpx;
- bottom: 8rpx;
- }
- }
- }
- }
-
- .boxs{
- width: 100%;
- padding: 0 24rpx;
- box-sizing: border-box;
- .box{
- margin-top: 20rpx;
- background: #FFFFFF;
- border-radius: 16rpx;
- padding: 36rpx 24rpx;
- position: relative;
- .place{
- font-family: PingFang-SC, PingFang-SC;
- font-weight: bold;
- font-size: 32rpx;
- color: #1D2129;
- line-height: 36rpx;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .pre{
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 24rpx;
- color: #86909C;
- line-height: 24rpx;
- margin-top: 24rpx;
- span{
- font-size: 26rpx;
- color: #1D2129;
- margin-left: 40rpx;
- }
- }
- .type{
- height: 48rpx;
- padding: 0 19rpx;
- border-radius: 0rpx 16rpx 0rpx 16rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- font-size: 26rpx;
- line-height: 48rpx;
- position: absolute;
- top: 0;
- right: 0;
- &.pt{
- background: rgba(20,204,140,.14);
- color: #14CC8C;
- }
- &.jj{
- background: rgba(254,164,0,.14);
- color: #FEA400;
- }
- &.fcjj{
- background: rgba(249,80,80,.14);
- color: #F95050;
- }
- &.mr{
- background: rgba(153,153,153,.14);
- color: #999999;
- }
- }
- }
- }
- }
- </style>
|