| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <!--
- * @Title:
- * @Description: RTU维修任务列表,包括正在处理和历史的任务
- * @Author: swp
- * @Date: 2022-08-24 10:49:21
- * @LastEditors:
- * @LastEditTime: 2022-08-24 10:49:21
- -->
- <template>
- <view class="wrap">
- <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
- @clickLeft="toBack">
- <view class="nav-title">
- <text>{{title}}</text>
- </view>
- </uni-nav-bar>
- <view class="container">
- <uni-list>
- <uni-list-item v-for="item in list" :key="item.id">
- <template v-slot:body>
- <view class="list-item-block">
- <view class="items-line">
- <image class="item-title-run-status-icon" style="box-shadow:0 0 2px 2px lightblue"
- src="/static/images/logo_pc.png" mode="widthFix">
- </image>
- <text class="item-title-rtu-name">{{item.rtuName}}</text>
- <text class="item-title-rtu-code">[{{item.rtuCode}}]</text>
- </view>
- <view class="items-line">
- <uni-icons class="input-uni-icon" type="list" size="18" color="lightblue" />
- <text class="item-text-lable">维修状态:</text>
- <text v-if="item.orderStatus==1" class="item-text-content" style="color: red;">等待确认</text>
- <text v-if="item.orderStatus==2" class="item-text-content" style="color: orange;">处理中</text>
- <text v-if="item.orderStatus==3" class="item-text-content" style="color: blue;">已处理</text>
- <text v-if="item.orderStatus==4" class="item-text-content" style="color: green;">已完成</text>
- </view>
- <view v-if="item.orderStatus==1" class="items-line">
- <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
- <text class="item-text-lable">创建时长:</text>
- <text class="item-text-content" style="color: red;">{{item.taskCreateDuration}}</text>
- </view>
- <view v-else class="items-line">
- <uni-icons class="input-uni-icon" type="calendar" size="18" color="lightblue" />
- <text class="item-text-lable">维修时长:</text>
- <text class="item-text-content" style="color: red;">{{item.taskProcessDuration}}</text>
- </view>
- <view v-if="item.orderStatus==1" class="items-line">
- <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
- <text class="item-text-lable">运维公司管理员:</text>
- <text class="item-text-content">{{item.manageCompanyAdminName}}</text>
- </view>
- <view v-else class="items-line">
- <uni-icons class="input-uni-icon" type="auth" size="18" color="lightblue" />
- <text class="item-text-lable">处理人:</text>
- <text class="item-text-content">{{item.contactUserName}}</text>
- </view>
- <view v-if="item.orderStatus==1" class="items-line">
- <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
- <text class="item-text-lable">联系电话:</text>
- <view v-if="item.manageCompanyAdminPhone != null" @click="call(item.manageCompanyAdminPhone)">
- <text class="item-text-content" style="text-decoration-line: underline;">{{item.manageCompanyAdminPhone}}</text>
- </view>
- </view>
- <view v-else class="items-line">
- <uni-icons class="input-uni-icon" type="phone" size="18" color="lightblue" />
- <text class="item-text-lable">联系电话:</text>
- <view v-if="item.contactPhone != null" @click="call(item.contactPhone)">
- <text class="item-text-content" style="text-decoration-line: underline;">{{item.contactPhone}}</text>
- </view>
- </view>
- <view class="item-button-group">
- <view class="item-button"
- @click="onDetailViewClick(item.id)">
- <view class="items-line">
- <uni-icons class="input-uni-icon" type="info" size="18" color="coral" />
- <text class="button-text">维修详情</text>
- </view>
- </view>
- </view>
- </view>
- </template>
- </uni-list-item>
- </uni-list>
- <uni-group>
- <view class="uni-pagination-box">
- <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
- @change="pageChange" />
- </view>
- </uni-group>
- </view>
- </view>
- </template>
- <script>
- import {
- role
- } from "@/api/role.js";
- import http from '@/http/api.js';
- export default {
- components: {
- },
- onLoad(option) {
- this.rtuCode = option.rtuCode;
- if (this.userInfo.role_name === role['admin']) {
- this.permission.admin = true;
- } else if (this.userInfo.role_name === role['orgAdmin']) {
- this.permission.orgAdmin = true;
- } else if (this.userInfo.role_name === role['companyAdmin']) {
- this.permission.companyAdmin = true;
- } else if (this.userInfo.role_name === role['companyServciePerson']) {
- this.permission.companyServciePerson = true;
- }
- let params = {};
- params['rtuCode'] = this.rtuCode;
- this.getPage(params);
- },
- data() {
- return {
- title: '维修任务信息',
- permission: {
- 'admin': false,
- 'orgAdmin': false,
- 'companyAdmin': false,
- 'companyServciePerson': false,
- },
- pageSize: 10,
- pageCurrent: 1,
- total: 0,
- list: [],
- query: {},
- rtuCode: '',
- }
- },
- computed: {
- },
- onShow() {
- },
- methods: {
- //返回上一页
- toBack() {
- uni.navigateBack({
- delta: 1
- })
- },
- onBackPress() {
- // #ifdef APP-PLUS
- plus.key.hideSoftKeybord();
- // #endif
- },
- // 分页触发
- pageChange(e) {
- this.pageCurrent = e.current;
- this.getPage()
- },
- onDetailViewClick(id) {
- let url = '/pages/check-order/orderprocessreportdetail?orderId=' + id;
- uni.navigateTo({
- url: url
- })
- },
- getAreaName(item) {
- let htmltext = '';
- if (item.adCity) {
- htmltext = htmltext + item.adCity;
- }
- if (item.adDist) {
- if (htmltext.length > 0) {
- htmltext = htmltext + ' / ';
- }
- htmltext = htmltext + item.adDist;
- }
- return htmltext;
- },
- getPage(params = {}) {
- const current = this.pageCurrent;
- const size = this.pageSize;
- let postData = Object.assign(params, this.query);
- let that = this;
- http.request({
- url: '/galaxy-business/rtu/check/order/page',
- method: 'GET',
- params: {
- current,
- size,
- },
- data: postData,
- }).then(res => {
- if (res.data.records != null) {
- that.list = res.data.records;
- }
- this.total = res.data.total;
- }).catch(err => {
- console.log(err)
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .nav-title {
- width: 100%;
- display: flex;
- flex-direction: row;
- justify-content: center;
- align-items: center;
- text {
- color: white;
- font-size: 1rem;
- }
- }
- .container {
- padding: 0 0 100rpx;
- }
- </style>
|