Commit b7fe5601388c72c8255478c1bf9fe8a2a5ca054f

Authored by zhangtingjun
1 parent ba09dc1a

移动端新增菜单

Showing 45 changed files with 4469 additions and 10 deletions

Too many changes to show.

To preserve performance only 45 of 94 files are displayed.

... ... @@ -28,7 +28,7 @@
28 28 // #ifdef H5
29 29 const userInfo = JSON.parse(sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo'));
30 30 // #endif
31   - return userInfo.isThirdLogin
  31 + return userInfo?.isThirdLogin
32 32 },
33 33
34 34 // 判断i18n是中文还是英文
... ...
  1 +/**
  2 + * params ((page,pageSize))
  3 + * data ((deviceProfileIds))
  4 + */
  5 +//保养计划列表
  6 +const getMaintenancePlanListApi = (urlParams, data) => {
  7 + const { page, pageSize } = urlParams
  8 + return uni.$u.http.post(`/yt/preservePlan/pageData?page=${page}&pageSize=${pageSize}`, data)
  9 +}
  10 +
  11 +// 保养计划列表详情
  12 +const getMaintenancePlanDetail = (id) => {
  13 + return uni.$u.http.get(`/yt/preservePlan/detail?id=${id}`)
  14 +}
  15 +
  16 +
  17 +//保养记录列表
  18 +const getMaintenanceRecordListApi = (urlParams, data) => {
  19 + const { page, pageSize } = urlParams
  20 + return uni.$u.http.post(`/yt/preserveRecord/pageData?page=${page}&pageSize=${pageSize}`, data)
  21 +}
  22 +
  23 +// 保养记录列表详情
  24 +const getMaintenanceRecordDetail = (id) => {
  25 + return uni.$u.http.get(`/yt/preserveRecord/detail?id=${id}`)
  26 +}
  27 +
  28 +
  29 +//保养明细列表
  30 +const getMaintenanceDetailApi = (urlParams, data) => {
  31 + const { page, pageSize } = urlParams
  32 + return uni.$u.http.post(`/yt/preservePlan/pageDetail?page=${page}&pageSize=${pageSize}`, data)
  33 +}
  34 +
  35 +//巡检计划列表
  36 +const getPatrolPlanListApi = (urlParams) => {
  37 + const { page, pageSize,type='',name='',startTimeStart='',startTimeEnd='',endTimeStart='',endTimeEnd=''} = urlParams
  38 + return uni.$u.http.get(`/yt/inspectionPlan?page=${page}&pageSize=${pageSize}&type=${type}&name=${name}&startTimeStart=${startTimeStart}&startTimeEnd=${startTimeEnd}&endTimeStart=${endTimeStart}&endTimeEnd=${endTimeEnd}`)
  39 +}
  40 +
  41 +// 巡检计划列表详情
  42 +const getPatrolPlanDetail = (id) => {
  43 + return uni.$u.http.get(`/yt/inspectionPlan/detail?id=${id}`)
  44 +}
  45 +
  46 +//巡检记录列表
  47 +const getPatrolRecordListApi = (urlParams) => {
  48 + const { page, pageSize,inspectionPlanId='',inspectorId='',startTime='',endTime='',recordResult='',inspectionPlanName='',deviceId = ''} = urlParams
  49 + return uni.$u.http.get(`/yt/inspectionRecord?page=${page}&pageSize=${pageSize}&inspectionPlanId=${inspectionPlanId}&inspectorId=${inspectorId}&startTime=${startTime}&endTime=${endTime}&recordResult=${recordResult}&inspectionPlanName=${inspectionPlanName}&deviceId=${deviceId}`)
  50 +}
  51 +
  52 +// 巡检记录列表详情
  53 +const getPatrolRecordDetail = (id) => {
  54 + return uni.$u.http.get(`/yt/inspectionRecord/detail?id=${id}`)
  55 +}
  56 +
  57 +
  58 +export default {
  59 + getMaintenancePlanListApi,
  60 + getMaintenancePlanDetail,
  61 + getMaintenanceRecordListApi,
  62 + getMaintenanceRecordDetail,
  63 + getMaintenanceDetailApi,
  64 + getPatrolPlanListApi,
  65 + getPatrolPlanDetail,
  66 + getPatrolRecordListApi,
  67 + getPatrolRecordDetail
  68 +
  69 +}
... ...
  1 +/**
  2 + * params ((page,pageSize))
  3 + * data ((deviceProfileIds))
  4 + */
  5 +
  6 +//设备类型
  7 +const getDeviceTypeApi = (data) => {
  8 + return uni.$u.http.post(`/yt/deviceCagegory/getAllCagegory`, data)
  9 +}
  10 +
  11 +//设备台账列表
  12 +const getLedgerListApi = (urlParams, data) => {
  13 + const { page, pageSize } = urlParams
  14 + return uni.$u.http.post(`/yt/da/pageData?page=${page}&pageSize=${pageSize}`, data)
  15 +}
  16 +
  17 +// 设备台账列表详情
  18 +const getLedgerListDetail = (id) => {
  19 + return uni.$u.http.get(`/yt/da/detail?id=${id}`)
  20 +}
  21 +
  22 +//故障原因列表
  23 +const getFaultListApi = (urlParams, data) => {
  24 + const { page, pageSize } = urlParams
  25 + return uni.$u.http.post(`/yt/mr/pageData?page=${page}&pageSize=${pageSize}`, data)
  26 +}
  27 +
  28 +// 故障原因列表详情
  29 +const getFaultListDetail = (id) => {
  30 + return uni.$u.http.get(`/yt/mr/detail?id=${id}`)
  31 +}
  32 +
  33 +
  34 +//巡检/保养方案列表
  35 +const getCheckPlanApi = (urlParams) => {
  36 + const { page, pageSize,type='',name='', status=''} = urlParams
  37 + return uni.$u.http.get(`/yt/checkPlan?page=${page}&pageSize=${pageSize}&type=${type}&name=${name}&status=${status}`)
  38 +}
  39 +
  40 +//巡检/保养方案列表详情
  41 +const getCheckPlanDetail = (id) => {
  42 + return uni.$u.http.get(`/yt/checkPlan/get?id=${id}`)
  43 +}
  44 +
  45 +
  46 +export default {
  47 + getFaultListApi,
  48 + getFaultListDetail,
  49 + getCheckPlanApi,
  50 + getCheckPlanDetail,
  51 + getLedgerListApi,
  52 + getLedgerListDetail,
  53 + getDeviceTypeApi
  54 +
  55 +}
... ...
  1 +/**
  2 + * params ((page,pageSize))
  3 + * data ((deviceProfileIds))
  4 + */
  5 +//维修工单列表
  6 +const getRepairWorkListApi = (urlParams, data) => {
  7 + const { page, pageSize } = urlParams
  8 + return uni.$u.http.post(`/yt/repairOrder/pageData?page=${page}&pageSize=${pageSize}`, data)
  9 +}
  10 +
  11 +// 维修工单列表详情
  12 +const getRepairWorkDetail = (id) => {
  13 + return uni.$u.http.get(`/yt/repairOrder/detail?id=${id}`)
  14 +}
  15 +
  16 +//维修记录
  17 +const getRepairRecordApi = (urlParams, data) => {
  18 + const { page, pageSize } = urlParams
  19 + return uni.$u.http.post(`/yt/repairRecord/pageData?page=${page}&pageSize=${pageSize}`, data)
  20 +}
  21 +
  22 +// 维修工单列表详情
  23 +const getRepairRecordDetail = (id) => {
  24 + return uni.$u.http.get(`/yt/repairRecord/detail?id=${id}`)
  25 +}
  26 +
  27 +
  28 +
  29 +export default {
  30 + getRepairWorkListApi,
  31 + getRepairWorkDetail,
  32 + getRepairRecordApi,
  33 + getRepairRecordDetail
  34 +
  35 +}
... ...
... ... @@ -21,11 +21,23 @@ import alarmApi from './alarmApi/index.js'
21 21 //设备
22 22 import deviceApi from './deviceApi/index.js'
23 23
  24 +//设备基础信息管理
  25 +import deviceManagementApi from './deviceManagementApi/index.js'
  26 +
  27 +//设备报修维修
  28 +import deviceRepairApi from './deviceRepairApi/index.js'
  29 +
  30 +//设备巡检保养
  31 +import deviceInspectApi from './deviceInspectApi/index.js'
  32 +
24 33 export default {
25 34 loginApi,
26 35 feedbackApi,
27 36 notifyApi,
28 37 homeApi,
29 38 alarmApi,
30   - deviceApi
  39 + deviceApi,
  40 + deviceManagementApi,
  41 + deviceRepairApi,
  42 + deviceInspectApi
31 43 }
... ...
  1 +<template>
  2 + <u-popup @close="$emit('close')" closeable bgColor="#fff" :show="show" mode="bottom" :round="20"
  3 + @touchmove.stop.prevent="disabledScroll">
  4 + <view class="filter" @touchmove.stop.prevent="disabledScroll">
  5 + <view class="filter-title"><text>{{ $t('common.filterCriteria') }}</text></view>
  6 + <view class="query-item" v-for="(item, index) in filterList">
  7 + <view class="query-title">
  8 + <text>{{ item.title }}</text>
  9 + </view>
  10 + <view class="query-list">
  11 + <view v-for="(itemChild, indexChild) in item.typeList" :key="indexChild" @click="handleClickTag(indexChild, item.typeList)"
  12 + :class="['tag-item', { checked: itemChild.checked, 'mr-30': (indexChild + 1) % 3 !== 0 }]">
  13 + {{ $t(itemChild.name) }}
  14 + </view>
  15 + </view>
  16 + <view class="select-date" v-if="item.isDate">
  17 + <view class="datetime-picker">
  18 + <uni-datetime-picker return-type="string" v-model="item.range" type="datetimerange"
  19 + :rangeSeparator="$t('common.toText')" />
  20 + </view>
  21 + </view>
  22 + </view>
  23 + <view class="button-group">
  24 + <view>
  25 + <u-button :customStyle="{ color: '#333' }" color="#e3e3e5" shape="circle" :text="$t('common.resetting')"
  26 + @click="resetFilter"></u-button>
  27 + </view>
  28 + <view>
  29 + <u-button color="#3388ff" shape="circle" :text="$t('common.confirm')" @click="confirmFilter"></u-button>
  30 + </view>
  31 + </view>
  32 + </view>
  33 + </u-popup>
  34 +</template>
  35 +
  36 +<script>
  37 + export default {
  38 + components: {
  39 +
  40 + },
  41 + props: {
  42 + show: Boolean,
  43 + filterList: {
  44 + type: Array,
  45 + default: () => []
  46 + },
  47 + filterName:Object
  48 + },
  49 + data() {
  50 + return {
  51 +
  52 +
  53 +
  54 + }
  55 + },
  56 +
  57 + methods: {
  58 + disabledScroll() {
  59 + return;
  60 + },
  61 + //点击选中的标签
  62 + handleClickTag(currentIndex, list) {
  63 + list.map((item, index) => {
  64 + item.checked = index === currentIndex;
  65 + });
  66 + },
  67 + //重置
  68 + resetFilter() {
  69 + this.filterList.forEach((item)=>{
  70 +
  71 + if(item.isDate){
  72 + item.range = []
  73 + }else{
  74 + item.typeList.forEach((item1)=>{
  75 + if(item1.name === '全部'){
  76 + item1.checked = true
  77 + }else{
  78 + item1.checked = false
  79 + }
  80 + })
  81 + }
  82 + })
  83 +
  84 + },
  85 + //确定
  86 + confirmFilter() {
  87 + let checkedList = this.filterName
  88 + this.filterList.forEach((item)=>{
  89 +
  90 + if(item.isDate){
  91 + if (Array.isArray(item.range)) {
  92 + checkedList[item.startDate] = item.range[0] ? item.range[0] : ''
  93 + checkedList[item.endDate] = item.range[1] ? item.range[1] : ''
  94 + }
  95 + }else{
  96 + item.typeList.forEach((item1)=>{
  97 + if(item1.checked){
  98 + checkedList[item.titleCode] = item1.code
  99 + }
  100 + })
  101 + }
  102 +
  103 + })
  104 + this.$emit('queryCondition', checkedList)
  105 + },
  106 +
  107 + change(e) {
  108 + // this.single = e;
  109 + // console.log("-change事件:", e);
  110 + },
  111 + }
  112 + }
  113 +</script>
  114 +
  115 +<style lang="scss" scoped>
  116 + .filter {
  117 + padding: 0 30rpx;
  118 +
  119 + .filter-title {
  120 + text-align: center;
  121 + margin-top: 14px;
  122 + font-size: 16px;
  123 + font-weight: 700;
  124 + }
  125 +
  126 + .button-group {
  127 + display: flex;
  128 + margin-top: 40rpx;
  129 + justify-content: space-between;
  130 +
  131 + view {
  132 + width: 330rpx;
  133 + }
  134 + }
  135 + .select-date {
  136 + display: flex;
  137 + flex-direction: column;
  138 + justify-content: space-between;
  139 + }
  140 +
  141 + .datetime-picker {
  142 + width: 640rpx;
  143 + margin-left: 5rpx;
  144 + margin-right: 70rpx;
  145 + margin-top: 35rpx;
  146 + }
  147 + .query-item {
  148 + margin-top: 40rpx;
  149 +
  150 + .query-title {
  151 + color: #333;
  152 + font-size: 14px;
  153 + font-weight: 700;
  154 + }
  155 +
  156 + .query-list {
  157 + display: flex;
  158 + flex-wrap: wrap;
  159 +
  160 + .tag-item {
  161 + margin-top: 30rpx;
  162 + min-width: 198rpx;
  163 + padding: 0 12rpx;
  164 + height: 68rpx;
  165 + border-radius: 32rpx;
  166 + display: flex;
  167 + justify-content: center;
  168 + align-items: center;
  169 + color: #333;
  170 + font-size: 13px;
  171 + border: 1px solid #fff;
  172 + background-color: #f6f6f6;
  173 + }
  174 +
  175 + .checked {
  176 + border: 1px solid #377dff4d;
  177 + background-color: #377dff0d;
  178 + color: #377dffff;
  179 + }
  180 +
  181 + .mr-30 {
  182 + margin-right: 30rpx;
  183 + }
  184 + }
  185 + }
  186 +
  187 + }
  188 +</style>
... ...
  1 +<template>
  2 + <u-sticky>
  3 + <view class="device-top">
  4 + <view class="search">
  5 + <view>
  6 + <view class="search-left" :style="{ width: width + 'rpx'}">
  7 + <slot></slot>
  8 + </view>
  9 + </view>
  10 + <view @click="$emit('openSearchDialog')" class="search-right" v-if="isShowSelect">
  11 + <text>{{ $t('common.screen') }}</text>
  12 + <image src="../../static/shaixuan.png" />
  13 + </view>
  14 + </view>
  15 + <u-line />
  16 + <view class="org" v-if="isShowTree">
  17 + <u-cell @click="$emit('openOrg')" isLink :title="title" :border="false">
  18 + <view slot="label" class="label" style="display: flex; align-items: center;margin-top: 20rpx;">
  19 + <image src="../../static/org.png" style="width: 24rpx;height: 28rpx;"></image>
  20 + <view style="margin-left: 10rpx; color: #666;">
  21 + {{totalText}}
  22 + <text style="margin-left: 20rpx;">{{ total }}</text>
  23 + </view>
  24 + </view>
  25 + </u-cell>
  26 + </view>
  27 + </view>
  28 + </u-sticky>
  29 +</template>
  30 +
  31 +<script>
  32 + export default {
  33 + props: {
  34 + isShowSelect:{
  35 + type: Boolean,
  36 + default: true
  37 + },
  38 + isShowTree:{
  39 + type: Boolean,
  40 + default: false
  41 + },
  42 + title:{
  43 + type: String,
  44 + default: ''
  45 + },
  46 + totalText:{
  47 + type: String,
  48 + default: ''
  49 + },
  50 + total:{
  51 + type:Number
  52 + },
  53 + width:{
  54 + type:Number
  55 + }
  56 +
  57 +
  58 + }
  59 + }
  60 +</script>
  61 +
  62 +<style lang="scss" scoped>
  63 + /deep/ .u-button--primary {
  64 + background-color: #377dff !important;
  65 + border-color: #377dff !important;
  66 + }
  67 +
  68 + /deep/ .u-button--info {
  69 + background-color: #e3e3e5 !important;
  70 + border-color: #e3e3e5 !important;
  71 + }
  72 +
  73 + /deep/ .u-cell__right-icon-wrap {
  74 + margin-top: -55rpx !important;
  75 + }
  76 +
  77 + /deep/ .uni-calendar--fixed {
  78 + bottom: 172rpx !important;
  79 + }
  80 +
  81 + .pop-no-scroll {
  82 + overflow: hidden;
  83 + position: fixed;
  84 + height: 100%;
  85 + width: 100%;
  86 + }
  87 +
  88 + .device-top {
  89 + padding: 10rpx 30rpx;
  90 + background-color: #fff;
  91 +
  92 + .search {
  93 + display: flex;
  94 + justify-content: space-between;
  95 + padding-bottom: 10rpx;
  96 +
  97 + .search-left {
  98 + width: 580rpx;
  99 + background-color: #f8f9fa;
  100 + border-radius: 200rpx;
  101 + }
  102 +
  103 + .search-right {
  104 + display: flex;
  105 + align-items: center;
  106 +
  107 + text {
  108 + color: #333;
  109 + font-size: 14px;
  110 + }
  111 +
  112 + image {
  113 + width: 40rpx;
  114 + height: 40rpx;
  115 + }
  116 + }
  117 + }
  118 + }
  119 +</style>
... ...
  1 +<template>
  2 + <view class="device-list">
  3 + <view @click="$emit('openDeviceDetail',item)"
  4 + class="list-item" v-for="item in list" :key="item.id">
  5 + <view class="u-flex item">
  6 + <view class="item-text text-clip title-bottom">
  7 + <view>
  8 + <text class="text-span-bold">{{ item.title ? item.title : '' }}</text>
  9 + </view>
  10 + </view>
  11 + <view class="item-text text-clip" v-for="itemChild in item.child">
  12 + <view class="text-container">
  13 + {{$t(itemChild.label)}}:
  14 + <text class="text-span">{{ itemChild.name ? itemChild.name : ''}}</text>
  15 + </view>
  16 + </view>
  17 + </view>
  18 + <view class="item right-item">
  19 + <view class="u-flex" style="margin-top: -6rpx">
  20 + <image class="right-image" :src="item.iconUrl ? item.iconUrl :''" />
  21 + <view>
  22 + <text class="right-text" :style="{ color:item.color ? item.color :'' }">
  23 + {{item.status ? item.status : ''}}
  24 + </text>
  25 + </view>
  26 + </view>
  27 + </view>
  28 + </view>
  29 + </view>
  30 +</template>
  31 +
  32 +<script>
  33 + export default {
  34 + props: {
  35 + list: {
  36 + type: Array,
  37 + default: []
  38 + }
  39 + },
  40 + methods: {
  41 + }
  42 + }
  43 +</script>
  44 +
  45 +<style lang="scss" scoped>
  46 + .device-list {
  47 + display: flex;
  48 + flex-direction: column;
  49 + padding-left: 20rpx;
  50 + .list-item:last-child{
  51 + margin-bottom: 40rpx;
  52 + }
  53 +
  54 + .list-item {
  55 + width: 713rpx;
  56 + // height: 200rpx;
  57 + background-color: #fff;
  58 + margin-top: 24rpx;
  59 + display: flex;
  60 + border-radius: 10px;
  61 + justify-content: space-between;
  62 + position: relative;
  63 +
  64 + .item {
  65 + margin: 30rpx;
  66 + flex-direction: column;
  67 + justify-content: space-between;
  68 +
  69 + .item-text {
  70 + width: 480rpx;
  71 +
  72 + .text-container {
  73 + display: flex;
  74 +
  75 + .text-span {
  76 + color: #666;
  77 + font-size: 14px;
  78 + display: flex;
  79 + margin-left: 20rpx;
  80 + }
  81 + }
  82 +
  83 +
  84 +
  85 + .text-span-bold {
  86 + color: #333;
  87 + font-size: 15px;
  88 + font-weight: bold;
  89 + }
  90 + }
  91 + .title-bottom{
  92 + margin-bottom: 10rpx;
  93 + }
  94 + }
  95 +
  96 + .right-item {
  97 + // margin:30rpx 30rpx 30rpx 0 ;
  98 + position: absolute;
  99 + right: 0;
  100 + top: 0;
  101 + .right-image {
  102 + width: 30rpx;
  103 + height: 30rpx;
  104 + margin-top: 5rpx;
  105 + margin-right: 5rpx;
  106 + }
  107 +
  108 + .right-text {
  109 + color: #377dff;
  110 + font-size: 13px;
  111 + margin-left: 5rpx;
  112 + margin-top: 20rpx;
  113 + }
  114 + }
  115 + }
  116 + }
  117 +</style>
... ...
... ... @@ -135,6 +135,34 @@
135 135 }
136 136 ]
137 137 //#endif
  138 + //#ifdef H5
  139 + list: [{
  140 + name: 'menu.homePage',
  141 + url: 'pages/index/index',
  142 + icon: '/static/home-un.png',
  143 + iconFill: '/static/home-yes.png'
  144 + },
  145 + {
  146 + name: 'menu.device',
  147 + url: 'pages/device/device',
  148 + icon: '/static/device-un.png',
  149 + iconFill: '/static/device-yes.png'
  150 + },
  151 + {
  152 + name: 'menu.alarm',
  153 + url: 'pages/alarm/alarm',
  154 + icon: '/static/alert-un.png',
  155 + iconFill: '/static/alert-yes.png',
  156 + badge: this.$store.state.badgeInfo
  157 + },
  158 + {
  159 + name: 'menu.my',
  160 + url: 'pages/personal/personal',
  161 + icon: '/static/my-un.png',
  162 + iconFill: '/static/my-yes.png'
  163 + }
  164 + ]
  165 + //#endif
138 166 };
139 167 },
140 168 created() {
... ...
... ... @@ -9,7 +9,14 @@ import { getTabbarHeight } from '@/plugins/utils'
9 9 * socketPrefix websocket前缀 ((https, wss),( http, ws))
10 10 */
11 11 // const baseUrl = 'http://222.180.200.114:30427/api'
12   -const baseUrl = 'http://192.168.1.235:9527/api'
  12 +// const baseUrl = 'http://192.168.1.235:9527/api'
  13 +// const baseUrl = 'http://10.9.0.205:9527/api'
  14 +
  15 +const baseUrl = 'http://10.9.4.101:8080/api'
  16 +
  17 +const baseImgUrl = 'http://10.9.4.101:8080'
  18 +
  19 +
13 20
14 21 //
15 22 // const baseVisualUrl = 'http://222.180.200.114:30427'
... ... @@ -56,6 +63,7 @@ const courtConfig = {
56 63 baseWebSocketUrl, //服务端websocket地址
57 64 socketPrefix, //websocket前缀
58 65 systemInfo: systemInfo, //系统信息
  66 + baseImgUrl,
59 67 mapData: {
60 68 key: '', //地图key
61 69 sk: '',
... ...
... ... @@ -18,7 +18,7 @@ uni.$u.http.setConfig((config) => {
18 18 uni.getStorageSync("userInfo").isToken ||
19 19 undefined;
20 20 // #ifdef H5
21   - window.sessionStorage.getItem("userInfo").isToken;
  21 + window.sessionStorage.getItem("userInfo")?.isToken;
22 22 // #endif
23 23 /* config 为默认全局配置*/
24 24 // const getConfiguration = uni.getStorageSync('getConfiguration').isConfiguration
... ...
  1 +const list = [
  2 + {
  3 + name: 'deviceInspect.basicInfo',
  4 + },
  5 + {
  6 + name: 'deviceInspect.preserveRecord',
  7 + }
  8 +]
  9 +
  10 +
  11 +export { list }
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <u-sticky :bgColor="bgColor">
  6 + <u-tabs :list="list.map(item=>({...item,name:$t(item.name)}))" :current="currentTab" :lineWidth="30" @click=" handleTabClick " :activeStyle="{activeColor}"
  7 + :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:center;height:44px" />
  8 + </u-sticky>
  9 + <view class="mt-3">
  10 + <view class="basic-box" v-show="currentTab == 0">
  11 + <view class="basic-header">
  12 + <view class="u-flex">
  13 + <view class="basic-text text-clip ml-2">
  14 + {{ listDetail.preserveCode }}
  15 + </view>
  16 + <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: planType[listDetail.status].color}">
  17 + {{ listDetail.status ? planType[listDetail.status].name : '' }}
  18 + </view>
  19 + </view>
  20 + </view>
  21 + <view class="detail">
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceInspect.preserveCode') }}</view>
  24 + <view class="detail-value">{{ listDetail.preserveCode}}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceInspect.preserveName') }}</view>
  29 + <view class="detail-value">{{ listDetail.preserveName}}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceInspect.frequency') }}</view>
  34 + <view class="detail-value">{{ listDetail.frequency }}</view>
  35 + </view>
  36 + <u-line length="90%" margin="0 auto"></u-line>
  37 + <view class="detail-item">
  38 + <view class="detail-label">{{ $t('deviceInspect.times') }}</view>
  39 + <view class="detail-value">{{ listDetail.times }}</view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <view class="record-box" v-show="currentTab == 1">
  44 + <!-- 列表分页 -->
  45 + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback"
  46 + @up="upCallback">
  47 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  48 + <mescroll-empty v-if="!listData.length" />
  49 + </mescroll-body>
  50 + </view>
  51 +
  52 + </view>
  53 + </view>
  54 +</template>
  55 +
  56 +<script>
  57 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  58 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  59 +import api from '@/api/index.js'
  60 +import {planType,preserveType} from '@/pages/deviceInspect/enum/index.js'
  61 +import { list } from './config/data.js'
  62 +import baseUrl from '@/config/baseUrl.js'
  63 +import pageList from '@/components/common/page-list'
  64 +
  65 +
  66 +export default {
  67 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  68 + components: {
  69 + fTabbar,
  70 + pageList
  71 +
  72 + },
  73 + data() {
  74 + return {
  75 + bgColor: '#fff',
  76 + activeColor: {
  77 + fontWeight: 'bold',
  78 + color: '#333',
  79 + },
  80 + inActiveColor: {
  81 + color: '#999',
  82 + },
  83 + listDetail:{},
  84 + list,
  85 + currentTab: 0,
  86 + isScrollable: false,
  87 + planType,
  88 + downOption: {
  89 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  90 + },
  91 + upOption: {
  92 + isBounce: false,
  93 + auto: false // 不自动加载
  94 + },
  95 + page: {
  96 + num: 0,
  97 + size: 10
  98 + },
  99 + startDate:'', //开始时间
  100 + endDate:'', //结束时间
  101 + preservePlanId:'', //保养计划id
  102 + preserveBy:'', //保养人id
  103 + preserveStatus:'', //状态
  104 + deviceId:'', //设备id
  105 + listData:[]
  106 +
  107 + };
  108 + },
  109 + onUnload() {
  110 +
  111 + },
  112 + async onLoad(options) {
  113 + // 隐藏原生的tabbar
  114 + uni.hideTabBar();
  115 + if (getApp().getBindNot()) {
  116 + return
  117 + }
  118 + let id = options.id
  119 + const res = await api.deviceInspectApi.getMaintenancePlanDetail(id)
  120 + if (!res) return
  121 + this.listDetail = {...res}
  122 +
  123 +
  124 + },
  125 + onShow(){
  126 + this.$nextTick(()=>{
  127 + uni.setNavigationBarTitle({
  128 + title:this.$t('menu.maintenancePlanDetail')
  129 + })
  130 + })
  131 +
  132 +
  133 + },
  134 + watch: {
  135 + currentTab: {
  136 + immediate: true,
  137 + handler(val) {
  138 + if(val == 1){
  139 + this.page.num = 1
  140 + this.loadData(this.page.num);
  141 + }
  142 +
  143 + }
  144 + },
  145 +
  146 +
  147 +
  148 + },
  149 +
  150 + methods: {
  151 + handleTabClick({index}) {
  152 + this.currentTab = index;
  153 + },
  154 +
  155 + formatImage(url) {
  156 + return baseUrl.baseImgUrl + url
  157 + },
  158 + //下拉刷新
  159 + downCallback() {
  160 + if (getApp().getBindNot()) {
  161 + setTimeout(() => {
  162 + this.mescroll.endByPage(0, 0)
  163 + }, 200)
  164 + return
  165 + }
  166 + this.listData = [];
  167 + this.page.num = 1;
  168 + this.loadData(this.page.num);
  169 + this.resetQuery();
  170 + },
  171 + //上拉加载
  172 + upCallback() {
  173 + if (getApp().getBindNot()) {
  174 + setTimeout(() => {
  175 + this.mescroll.endByPage(0, 0)
  176 + }, 200)
  177 + return
  178 + }
  179 + this.page.num += 1;
  180 + this.loadData(this.page.num);
  181 + },
  182 + //获取列表
  183 + async loadData(pageNo,params={}) {
  184 + try {
  185 + let httpData = {
  186 + page: pageNo,
  187 + pageSize: 10,
  188 + };
  189 + const httpPostData = {
  190 + startDate:this.startDate, //开始时间
  191 + endDate:this.endDate, //结束时间
  192 + preservePlanId:this.listDetail.id, //保养计划id
  193 + preserveBy:this.preserveBy, //保养人id
  194 + preserveStatus:this.preserveStatus, //状态
  195 + deviceId:'', //设备id
  196 + ...params
  197 + }
  198 + const {
  199 + total,
  200 + items
  201 + } = await api.deviceInspectApi.getMaintenanceRecordListApi(httpData, httpPostData)
  202 +
  203 + let data = items
  204 + let newList = data.map((item)=>{
  205 + return {
  206 + id:item.id,
  207 + title:item.recordCode,
  208 + status:item.preserveStatus ? preserveType[item.preserveStatus].name : '',
  209 + iconUrl:item.preserveStatus ? preserveType[item.preserveStatus].iconUrl : '',
  210 + color:item.preserveStatus ? preserveType[item.preserveStatus].color : '',
  211 + child:[
  212 + {
  213 + label:'deviceInspect.preserveDate',
  214 + name:item.preserveDate
  215 + },
  216 + {
  217 + label:'deviceInspect.preserveByName',
  218 + name:item.preserveByName
  219 + },
  220 + {
  221 + label:'deviceInspect.preserveStatus',
  222 + name:item.preserveStatus ? preserveType[item.preserveStatus].name :''
  223 + }
  224 +
  225 + ],
  226 + detail:{
  227 + ...item
  228 + }
  229 + }
  230 + })
  231 + uni.stopPullDownRefresh();
  232 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  233 + if (pageNo == 1) {
  234 + this.listData = newList;
  235 + } else {
  236 + this.listData = this.listData.concat(newList);
  237 + }
  238 +
  239 +
  240 + } catch {
  241 + this.mescroll.endErr();
  242 + }
  243 + },
  244 +
  245 +
  246 + },
  247 +};
  248 +</script>
  249 +
  250 +<style lang="scss" scoped>
  251 +.device-detail-page {
  252 + min-height: 100vh;
  253 + background-color: #f8f9fa;
  254 + // padding: 0 30rpx;
  255 + .mt-3{
  256 + // padding: 0 30rpx;
  257 + margin-top: 0;
  258 + .basic-box{
  259 + margin-top: 30rpx;
  260 + padding: 0 30rpx;
  261 + }
  262 + .record-box{
  263 + // padding: 0 30rpx 0 15rpx;
  264 + }
  265 + }
  266 + .basic-header {
  267 + display: flex;
  268 + justify-content: space-between;
  269 + align-items: center;
  270 + height: 140rpx;
  271 + background-color: #fff;
  272 + border-radius: 20rpx;
  273 + padding-left: 40rpx;
  274 + padding-right:20rpx;
  275 +
  276 +
  277 + .basic-text {
  278 + width: 370rpx;
  279 + }
  280 +
  281 + .cu-item {
  282 + background: #3388ff;
  283 + border-radius: 12px;
  284 + width: 120rpx;
  285 + height: 48rpx;
  286 + text-align: center;
  287 + line-height: 40rpx;
  288 +
  289 + text {
  290 + font-size: 12px;
  291 + font-family: PingFangSC-Regular, PingFang SC;
  292 + font-weight: 400;
  293 + color: #ffffff;
  294 + }
  295 + }
  296 +
  297 + .basic-text-status {
  298 + font-size: 14px;
  299 + }
  300 + }
  301 + .detail {
  302 + background-color: #fff;
  303 + margin-top: 30rpx;
  304 + border-radius: 20rpx;
  305 + width: 690rpx;
  306 +
  307 + .detail-item {
  308 + padding: 30rpx;
  309 + display: flex;
  310 + align-items: center;
  311 +
  312 + .detail-label {
  313 + color: #333;
  314 + font-size: 15px;
  315 + }
  316 +
  317 + .detail-value {
  318 + color: #666;
  319 + font-size: 14px;
  320 + margin-left: 30rpx;
  321 + .detail-img{
  322 + width: 60rpx;
  323 + height: 60rpx;
  324 + }
  325 + }
  326 + }
  327 + }
  328 +}
  329 +</style>
... ...
  1 +const list = [
  2 + {
  3 + name: 'deviceInspect.basicInfo',
  4 + },
  5 + {
  6 + name: 'deviceInspect.preserveDetail',
  7 + }
  8 +]
  9 +
  10 +
  11 +export { list }
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <u-sticky :bgColor="bgColor">
  6 + <u-tabs :list="list.map(item=>({...item,name:$t(item.name)}))" :current="currentTab" :lineWidth="30" @click=" handleTabClick " :activeStyle="{activeColor}"
  7 + :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:center;height:44px" />
  8 + </u-sticky>
  9 + <view class="mt-3">
  10 + <view class="basic-box" v-show="currentTab == 0">
  11 + <view class="basic-header">
  12 + <view class="u-flex">
  13 + <view class="basic-text text-clip ml-2">
  14 + {{ listDetail.recordCode }}
  15 + </view>
  16 + <view v-if="listDetail.preserveStatus" class="basic-text-status ml-2" :style="{ color: preserveType[listDetail.preserveStatus].color}">
  17 + {{ listDetail.preserveStatus ? preserveType[listDetail.preserveStatus].name : '' }}
  18 + </view>
  19 + </view>
  20 + </view>
  21 + <view class="detail">
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceInspect.recordCode') }}</view>
  24 + <view class="detail-value">{{ listDetail.recordCode}}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceInspect.preserveDate') }}</view>
  29 + <view class="detail-value">{{ listDetail.preserveDate}}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceInspect.preserveByName') }}</view>
  34 + <view class="detail-value">{{ listDetail.preserveByName }}</view>
  35 + </view>
  36 + <u-line length="90%" margin="0 auto"></u-line>
  37 + <view class="detail-item">
  38 + <view class="detail-label">{{ $t('deviceInspect.preservePlanName') }}</view>
  39 + <view class="detail-value">{{ listDetail.preservePlanName }}</view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <view class="record-box" v-show="currentTab == 1">
  44 + <!-- 列表分页 -->
  45 + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback"
  46 + @up="upCallback">
  47 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  48 + <mescroll-empty v-if="!listData.length" />
  49 + </mescroll-body>
  50 + </view>
  51 +
  52 + </view>
  53 + </view>
  54 +</template>
  55 +
  56 +<script>
  57 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  58 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  59 +import api from '@/api/index.js'
  60 +import {planType,preserveType,detailType} from '@/pages/deviceInspect/enum/index.js'
  61 +import { list } from './config/data.js'
  62 +import baseUrl from '@/config/baseUrl.js'
  63 +import pageList from '@/components/common/page-list'
  64 +
  65 +
  66 +export default {
  67 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  68 + components: {
  69 + fTabbar,
  70 + pageList
  71 +
  72 + },
  73 + data() {
  74 + return {
  75 + bgColor: '#fff',
  76 + activeColor: {
  77 + fontWeight: 'bold',
  78 + color: '#333',
  79 + },
  80 + inActiveColor: {
  81 + color: '#999',
  82 + },
  83 + listDetail:{},
  84 + list,
  85 + preserveType,
  86 + currentTab: 0,
  87 + detailType,
  88 + isScrollable: false,
  89 + planType,
  90 + downOption: {
  91 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  92 + },
  93 + upOption: {
  94 + isBounce: false,
  95 + auto: false // 不自动加载
  96 + },
  97 + page: {
  98 + num: 0,
  99 + size: 10
  100 + },
  101 + preservePlanId:'', //保养计划id
  102 + listData:[]
  103 +
  104 + };
  105 + },
  106 + onUnload() {
  107 +
  108 + },
  109 + async onLoad(options) {
  110 + // 隐藏原生的tabbar
  111 + uni.hideTabBar();
  112 + if (getApp().getBindNot()) {
  113 + return
  114 + }
  115 + let id = options.id
  116 + const res = await api.deviceInspectApi.getMaintenanceRecordDetail(id)
  117 + if (!res) return
  118 + this.listDetail = {...res}
  119 +
  120 +
  121 + },
  122 + onShow(){
  123 + this.$nextTick(()=>{
  124 + uni.setNavigationBarTitle({
  125 + title:this.$t('menu.maintenanceRecordDetail')
  126 + })
  127 + })
  128 +
  129 +
  130 + },
  131 + watch: {
  132 + currentTab: {
  133 + immediate: true,
  134 + handler(val) {
  135 + if(val == 1){
  136 + this.page.num = 1
  137 + this.loadData(this.page.num);
  138 + }
  139 +
  140 + }
  141 + },
  142 +
  143 +
  144 +
  145 + },
  146 +
  147 + methods: {
  148 + handleTabClick({index}) {
  149 + this.currentTab = index;
  150 + },
  151 +
  152 + formatImage(url) {
  153 + return baseUrl.baseImgUrl + url
  154 + },
  155 + //下拉刷新
  156 + downCallback() {
  157 + if (getApp().getBindNot()) {
  158 + setTimeout(() => {
  159 + this.mescroll.endByPage(0, 0)
  160 + }, 200)
  161 + return
  162 + }
  163 + this.listData = [];
  164 + this.page.num = 1;
  165 + this.loadData(this.page.num);
  166 + this.resetQuery();
  167 + },
  168 + //上拉加载
  169 + upCallback() {
  170 + if (getApp().getBindNot()) {
  171 + setTimeout(() => {
  172 + this.mescroll.endByPage(0, 0)
  173 + }, 200)
  174 + return
  175 + }
  176 + this.page.num += 1;
  177 + this.loadData(this.page.num);
  178 + },
  179 + //获取列表
  180 + async loadData(pageNo) {
  181 + try {
  182 + let httpData = {
  183 + page: pageNo,
  184 + pageSize: 10,
  185 + };
  186 + const httpPostData = {
  187 + preservePlanId:this.listDetail.preservePlanId, //保养计划id
  188 + }
  189 + const {
  190 + total,
  191 + items
  192 + } = await api.deviceInspectApi.getMaintenanceDetailApi(httpData, httpPostData)
  193 +
  194 + let data = items
  195 + let newList = data.map((item)=>{
  196 + return {
  197 + id:item.id,
  198 + title:item.deviceInfo ? item.deviceInfo.name : '',
  199 + status:item.detailStatus ? detailType[item.detailStatus].name : '',
  200 + iconUrl:item.detailStatus ? detailType[item.detailStatus].iconUrl : '',
  201 + color:item.detailStatus ? detailType[item.detailStatus].color : '',
  202 + child:[
  203 + {
  204 + label:'deviceInspect.preserveDetail',
  205 + name:item.preserveDetail
  206 + },
  207 + {
  208 + label:'deviceInspect.checkPlanName',
  209 + name:item.checkPlanName
  210 + }
  211 + ],
  212 + detail:{
  213 + ...item
  214 + }
  215 + }
  216 + })
  217 + uni.stopPullDownRefresh();
  218 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  219 + if (pageNo == 1) {
  220 + this.listData = newList;
  221 + } else {
  222 + this.listData = this.listData.concat(newList);
  223 + }
  224 +
  225 +
  226 + } catch {
  227 + this.mescroll.endErr();
  228 + }
  229 + },
  230 +
  231 +
  232 + },
  233 +};
  234 +</script>
  235 +
  236 +<style lang="scss" scoped>
  237 +.device-detail-page {
  238 + min-height: 100vh;
  239 + background-color: #f8f9fa;
  240 + // padding: 0 30rpx;
  241 + .mt-3{
  242 + // padding: 0 30rpx;
  243 + margin-top: 0;
  244 + .basic-box{
  245 + margin-top: 30rpx;
  246 + padding: 0 30rpx;
  247 + }
  248 + .record-box{
  249 + // padding: 0 30rpx 0 15rpx;
  250 + }
  251 + }
  252 + .basic-header {
  253 + display: flex;
  254 + justify-content: space-between;
  255 + align-items: center;
  256 + height: 140rpx;
  257 + background-color: #fff;
  258 + border-radius: 20rpx;
  259 + padding-left: 40rpx;
  260 + padding-right:20rpx;
  261 +
  262 +
  263 + .basic-text {
  264 + width: 370rpx;
  265 + }
  266 +
  267 + .cu-item {
  268 + background: #3388ff;
  269 + border-radius: 12px;
  270 + width: 120rpx;
  271 + height: 48rpx;
  272 + text-align: center;
  273 + line-height: 40rpx;
  274 +
  275 + text {
  276 + font-size: 12px;
  277 + font-family: PingFangSC-Regular, PingFang SC;
  278 + font-weight: 400;
  279 + color: #ffffff;
  280 + }
  281 + }
  282 +
  283 + .basic-text-status {
  284 + font-size: 14px;
  285 + }
  286 + }
  287 + .detail {
  288 + background-color: #fff;
  289 + margin-top: 30rpx;
  290 + border-radius: 20rpx;
  291 + width: 690rpx;
  292 +
  293 + .detail-item {
  294 + padding: 30rpx;
  295 + display: flex;
  296 + align-items: center;
  297 +
  298 + .detail-label {
  299 + color: #333;
  300 + font-size: 15px;
  301 + }
  302 +
  303 + .detail-value {
  304 + color: #666;
  305 + font-size: 14px;
  306 + margin-left: 30rpx;
  307 + .detail-img{
  308 + width: 60rpx;
  309 + height: 60rpx;
  310 + }
  311 + }
  312 + }
  313 + }
  314 +}
  315 +</style>
... ...
  1 +const list = [
  2 + {
  3 + name: 'deviceInspect.basicInfo',
  4 + },
  5 + {
  6 + name: 'deviceInspect.patrolRecord',
  7 + }
  8 +]
  9 +
  10 +
  11 +export { list }
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <u-sticky :bgColor="bgColor">
  6 + <u-tabs :list="list.map(item=>({...item,name:$t(item.name)}))" :current="currentTab" :lineWidth="30" @click=" handleTabClick " :activeStyle="{activeColor}"
  7 + :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:center;height:44px" />
  8 + </u-sticky>
  9 + <view class="mt-3">
  10 + <view class="basic-box" v-show="currentTab == 0">
  11 + <view class="basic-header">
  12 + <view class="u-flex">
  13 + <view class="basic-text text-clip ml-2">
  14 + {{ listDetail.code }}
  15 + </view>
  16 + <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: inspectionType[listDetail.status].color}">
  17 + {{ listDetail.status ? inspectionType[listDetail.status].name : '' }}
  18 + </view>
  19 + </view>
  20 + </view>
  21 + <view class="detail">
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceInspect.preserveCode') }}</view>
  24 + <view class="detail-value">{{ listDetail.code}}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceInspect.preserveName') }}</view>
  29 + <view class="detail-value">{{ listDetail.name}}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceInspect.startTime') }}</view>
  34 + <view class="detail-value">{{ listDetail.startTime }}</view>
  35 + </view>
  36 + <u-line length="90%" margin="0 auto"></u-line>
  37 + <view class="detail-item">
  38 + <view class="detail-label">{{ $t('deviceInspect.endTime') }}</view>
  39 + <view class="detail-value">{{ listDetail.endTime }}</view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <view class="record-box" v-show="currentTab == 1">
  44 + <!-- 列表分页 -->
  45 + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback"
  46 + @up="upCallback">
  47 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  48 + <mescroll-empty v-if="!listData.length" />
  49 + </mescroll-body>
  50 + </view>
  51 +
  52 + </view>
  53 + </view>
  54 +</template>
  55 +
  56 +<script>
  57 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  58 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  59 +import api from '@/api/index.js'
  60 +import {planType,preserveType,detailType,inspectionType,inspectionResult} from '@/pages/deviceInspect/enum/index.js'
  61 +import { list } from './config/data.js'
  62 +import baseUrl from '@/config/baseUrl.js'
  63 +import pageList from '@/components/common/page-list'
  64 +
  65 +
  66 +export default {
  67 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  68 + components: {
  69 + fTabbar,
  70 + pageList
  71 +
  72 + },
  73 + data() {
  74 + return {
  75 + bgColor: '#fff',
  76 + activeColor: {
  77 + fontWeight: 'bold',
  78 + color: '#333',
  79 + },
  80 + inActiveColor: {
  81 + color: '#999',
  82 + },
  83 + listDetail:{},
  84 + list,
  85 + inspectionType,
  86 + preserveType,
  87 + currentTab: 0,
  88 + detailType,
  89 + isScrollable: false,
  90 + planType,
  91 + downOption: {
  92 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  93 + },
  94 + upOption: {
  95 + isBounce: false,
  96 + auto: false // 不自动加载
  97 + },
  98 + page: {
  99 + num: 0,
  100 + size: 10
  101 + },
  102 + preservePlanId:'', //保养计划id
  103 + listData:[]
  104 +
  105 + };
  106 + },
  107 + onUnload() {
  108 +
  109 + },
  110 + async onLoad(options) {
  111 + // 隐藏原生的tabbar
  112 + uni.hideTabBar();
  113 + if (getApp().getBindNot()) {
  114 + return
  115 + }
  116 + let id = options.id
  117 + const res = await api.deviceInspectApi.getPatrolPlanDetail(id)
  118 + if (!res) return
  119 + this.listDetail = {...res}
  120 +
  121 +
  122 + },
  123 + onShow(){
  124 + this.$nextTick(()=>{
  125 + uni.setNavigationBarTitle({
  126 + title:this.$t('menu.patrolPlanDetail')
  127 + })
  128 + })
  129 +
  130 +
  131 + },
  132 + watch: {
  133 + currentTab: {
  134 + immediate: true,
  135 + handler(val) {
  136 + if(val == 1){
  137 + this.page.num = 1
  138 + this.loadData(this.page.num);
  139 + }
  140 +
  141 + }
  142 + },
  143 +
  144 +
  145 +
  146 + },
  147 +
  148 + methods: {
  149 + handleTabClick({index}) {
  150 + this.currentTab = index;
  151 + },
  152 +
  153 + formatImage(url) {
  154 + return baseUrl.baseImgUrl + url
  155 + },
  156 + //下拉刷新
  157 + downCallback() {
  158 + if (getApp().getBindNot()) {
  159 + setTimeout(() => {
  160 + this.mescroll.endByPage(0, 0)
  161 + }, 200)
  162 + return
  163 + }
  164 + this.listData = [];
  165 + this.page.num = 1;
  166 + this.loadData(this.page.num);
  167 + this.resetQuery();
  168 + },
  169 + //上拉加载
  170 + upCallback() {
  171 + if (getApp().getBindNot()) {
  172 + setTimeout(() => {
  173 + this.mescroll.endByPage(0, 0)
  174 + }, 200)
  175 + return
  176 + }
  177 + this.page.num += 1;
  178 + this.loadData(this.page.num);
  179 + },
  180 + //获取列表
  181 + async loadData(pageNo) {
  182 +
  183 + try {
  184 + let httpData = {
  185 + page: pageNo,
  186 + pageSize: 10,
  187 + inspectionPlanId:this.listDetail.id,
  188 + inspectorId:'',
  189 + startTime:'',
  190 + endTime:'',
  191 + recordResult:''
  192 + };
  193 +
  194 + const {
  195 + total,
  196 + items
  197 + } = await api.deviceInspectApi.getPatrolRecordListApi(httpData)
  198 +
  199 + let data = items
  200 +
  201 + let newList = data.map((item)=>{
  202 + return {
  203 + id:item.id,
  204 + title:item.code,
  205 + status:item.recordResult ? inspectionResult[item.recordResult].name : '',
  206 + iconUrl:item.recordResult ? inspectionResult[item.recordResult].iconUrl : '',
  207 + color:item.recordResult ? inspectionResult[item.recordResult].color : '',
  208 + child:[
  209 + {
  210 + label:'deviceInspect.recordCode',
  211 + name:item.code
  212 + },
  213 + {
  214 + label:'deviceInspect.patrolPlan',
  215 + name:item.tkInspectionPlanDTO ? item.tkInspectionPlanDTO.name : ''
  216 + },
  217 + {
  218 + label:'deviceInspect.patrolByName',
  219 + name:item.userDTO ? item.userDTO.realName : ''
  220 + },
  221 + {
  222 + label:'deviceInspect.checkDate',
  223 + name:item.checkDate
  224 + },
  225 + ],
  226 + detail:{
  227 + ...item
  228 + }
  229 + }
  230 + })
  231 + uni.stopPullDownRefresh();
  232 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  233 + if (pageNo == 1) {
  234 + this.listData = newList;
  235 + } else {
  236 + this.listData = this.listData.concat(newList);
  237 + }
  238 +
  239 +
  240 + } catch {
  241 + this.mescroll.endErr();
  242 + }
  243 + },
  244 +
  245 +
  246 + },
  247 +};
  248 +</script>
  249 +
  250 +<style lang="scss" scoped>
  251 +.device-detail-page {
  252 + min-height: 100vh;
  253 + background-color: #f8f9fa;
  254 + // padding: 0 30rpx;
  255 + .mt-3{
  256 + // padding: 0 30rpx;
  257 + margin-top: 0;
  258 + .basic-box{
  259 + margin-top: 30rpx;
  260 + padding: 0 30rpx;
  261 + }
  262 + .record-box{
  263 + // padding: 0 30rpx 0 15rpx;
  264 + }
  265 + }
  266 + .basic-header {
  267 + display: flex;
  268 + justify-content: space-between;
  269 + align-items: center;
  270 + height: 140rpx;
  271 + background-color: #fff;
  272 + border-radius: 20rpx;
  273 + padding-left: 40rpx;
  274 + padding-right:20rpx;
  275 +
  276 +
  277 + .basic-text {
  278 + width: 370rpx;
  279 + }
  280 +
  281 + .cu-item {
  282 + background: #3388ff;
  283 + border-radius: 12px;
  284 + width: 120rpx;
  285 + height: 48rpx;
  286 + text-align: center;
  287 + line-height: 40rpx;
  288 +
  289 + text {
  290 + font-size: 12px;
  291 + font-family: PingFangSC-Regular, PingFang SC;
  292 + font-weight: 400;
  293 + color: #ffffff;
  294 + }
  295 + }
  296 +
  297 + .basic-text-status {
  298 + font-size: 14px;
  299 + }
  300 + }
  301 + .detail {
  302 + background-color: #fff;
  303 + margin-top: 30rpx;
  304 + border-radius: 20rpx;
  305 + width: 690rpx;
  306 +
  307 + .detail-item {
  308 + padding: 30rpx;
  309 + display: flex;
  310 + align-items: center;
  311 +
  312 + .detail-label {
  313 + color: #333;
  314 + font-size: 15px;
  315 + }
  316 +
  317 + .detail-value {
  318 + color: #666;
  319 + font-size: 14px;
  320 + margin-left: 30rpx;
  321 + .detail-img{
  322 + width: 60rpx;
  323 + height: 60rpx;
  324 + }
  325 + }
  326 + }
  327 + }
  328 +}
  329 +</style>
... ...
  1 +const list = [
  2 + {
  3 + name: 'deviceInspect.basicInfo',
  4 + },
  5 + {
  6 + name: 'deviceInspect.patrolDetail',
  7 + }
  8 +]
  9 +
  10 +
  11 +export { list }
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <u-sticky :bgColor="bgColor">
  6 + <u-tabs :list="list.map(item=>({...item,name:$t(item.name)}))" :current="currentTab" :lineWidth="30" @click=" handleTabClick " :activeStyle="{activeColor}"
  7 + :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:center;height:44px" />
  8 + </u-sticky>
  9 + <view class="mt-3">
  10 + <view class="basic-box" v-show="currentTab == 0">
  11 + <view class="basic-header">
  12 + <view class="u-flex">
  13 + <view class="basic-text text-clip ml-2">
  14 + {{ listDetail.code }}
  15 + </view>
  16 + <view v-if="listDetail.recordResult" class="basic-text-status ml-2" :style="{ color: inspectionResult[listDetail.recordResult].color}">
  17 + {{ listDetail.recordResult ? inspectionResult[listDetail.recordResult].name : '' }}
  18 + </view>
  19 + </view>
  20 + </view>
  21 + <view class="detail">
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceInspect.recordCode') }}</view>
  24 + <view class="detail-value">{{ listDetail.code}}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceInspect.patrolPlan') }}</view>
  29 + <view class="detail-value">{{ listDetail.tkInspectionPlanDTO ? listDetail.tkInspectionPlanDTO.name :''}}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceInspect.patrolByName') }}</view>
  34 + <view class="detail-value">{{ listDetail.userDTO ? listDetail.userDTO.realName : '' }}</view>
  35 + </view>
  36 + <u-line length="90%" margin="0 auto"></u-line>
  37 + <view class="detail-item">
  38 + <view class="detail-label">{{ $t('deviceInspect.checkDate') }}</view>
  39 + <view class="detail-value">{{ listDetail.checkDate }}</view>
  40 + </view>
  41 + </view>
  42 + </view>
  43 + <view class="record-box" v-show="currentTab == 1">
  44 + <!-- 列表分页 -->
  45 + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback"
  46 + @up="upCallback">
  47 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  48 + <mescroll-empty v-if="!listData.length" />
  49 + </mescroll-body>
  50 + </view>
  51 +
  52 + </view>
  53 + </view>
  54 +</template>
  55 +
  56 +<script>
  57 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  58 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  59 +import api from '@/api/index.js'
  60 +import {planType,preserveType,detailType,inspectionType,inspectionResult} from '@/pages/deviceInspect/enum/index.js'
  61 +import { list } from './config/data.js'
  62 +import baseUrl from '@/config/baseUrl.js'
  63 +import pageList from '@/components/common/page-list'
  64 +
  65 +
  66 +export default {
  67 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  68 + components: {
  69 + fTabbar,
  70 + pageList
  71 +
  72 + },
  73 + data() {
  74 + return {
  75 + bgColor: '#fff',
  76 + activeColor: {
  77 + fontWeight: 'bold',
  78 + color: '#333',
  79 + },
  80 + inActiveColor: {
  81 + color: '#999',
  82 + },
  83 + listDetail:{},
  84 + list,
  85 + inspectionType,
  86 + inspectionResult,
  87 + preserveType,
  88 + currentTab: 0,
  89 + detailType,
  90 + isScrollable: false,
  91 + planType,
  92 + downOption: {
  93 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  94 + },
  95 + upOption: {
  96 + isBounce: false,
  97 + auto: false // 不自动加载
  98 + },
  99 + page: {
  100 + num: 0,
  101 + size: 10
  102 + },
  103 + preservePlanId:'', //保养计划id
  104 + listData:[]
  105 +
  106 + };
  107 + },
  108 + onUnload() {
  109 +
  110 + },
  111 + async onLoad(options) {
  112 + // 隐藏原生的tabbar
  113 + uni.hideTabBar();
  114 + if (getApp().getBindNot()) {
  115 + return
  116 + }
  117 + let id = options.id
  118 + const res = await api.deviceInspectApi.getPatrolRecordDetail(id)
  119 + if (!res) return
  120 + this.listDetail = {...res}
  121 +
  122 +
  123 + },
  124 + onShow(){
  125 + this.$nextTick(()=>{
  126 + uni.setNavigationBarTitle({
  127 + title:this.$t('menu.patrolRecordDetail')
  128 + })
  129 + })
  130 +
  131 +
  132 + },
  133 + watch: {
  134 + currentTab: {
  135 + immediate: true,
  136 + handler(val) {
  137 + if(val == 1){
  138 + this.loadData();
  139 + }
  140 +
  141 + }
  142 + },
  143 +
  144 +
  145 +
  146 + },
  147 +
  148 + methods: {
  149 + handleTabClick({index}) {
  150 + this.currentTab = index;
  151 + },
  152 +
  153 + formatImage(url) {
  154 + return baseUrl.baseImgUrl + url
  155 + },
  156 + //下拉刷新
  157 + downCallback() {
  158 + if (getApp().getBindNot()) {
  159 + setTimeout(() => {
  160 + this.mescroll.endByPage(0, 0)
  161 + }, 200)
  162 + return
  163 + }
  164 + this.loadData();
  165 + // this.listData = [];
  166 + // this.page.num = 1;
  167 + // this.loadData(this.page.num);
  168 + // this.resetQuery();
  169 + },
  170 + //上拉加载
  171 + upCallback() {
  172 + if (getApp().getBindNot()) {
  173 + setTimeout(() => {
  174 + this.mescroll.endByPage(0, 0)
  175 + }, 200)
  176 + return
  177 + }
  178 +
  179 + // this.page.num += 1;
  180 + this.loadData();
  181 + },
  182 + //获取列表
  183 + loadData() {
  184 + let data = this.listDetail.tkInspectionDetailsDTOList
  185 + let newList = data.map((item)=>{
  186 + return {
  187 + id:item.id,
  188 + title:item.patrolDevice,
  189 + status:item.recordResult ? inspectionResult[item.recordResult].name : '',
  190 + iconUrl:item.recordResult ? inspectionResult[item.recordResult].iconUrl : '',
  191 + color:item.recordResult ? inspectionResult[item.recordResult].color : '',
  192 + child:[
  193 + {
  194 + label:'deviceInspect.patrolDevice',
  195 + name:item.tkDeviceAccountDTO ? item.tkDeviceAccountDTO.name : ''
  196 + },
  197 + {
  198 + label:'deviceInspect.patrolContent',
  199 + name:item.planDetails
  200 + },
  201 + ],
  202 + detail:{
  203 + ...item
  204 + }
  205 + }
  206 + })
  207 + this.listData = newList
  208 +
  209 + },
  210 +
  211 +
  212 + },
  213 +};
  214 +</script>
  215 +
  216 +<style lang="scss" scoped>
  217 +.device-detail-page {
  218 + min-height: 100vh;
  219 + background-color: #f8f9fa;
  220 + // padding: 0 30rpx;
  221 + .mt-3{
  222 + // padding: 0 30rpx;
  223 + margin-top: 0;
  224 + .basic-box{
  225 + margin-top: 30rpx;
  226 + padding: 0 30rpx;
  227 + }
  228 + .record-box{
  229 + // padding: 0 30rpx 0 15rpx;
  230 + }
  231 + }
  232 + .basic-header {
  233 + display: flex;
  234 + justify-content: space-between;
  235 + align-items: center;
  236 + height: 140rpx;
  237 + background-color: #fff;
  238 + border-radius: 20rpx;
  239 + padding-left: 40rpx;
  240 + padding-right:20rpx;
  241 +
  242 +
  243 + .basic-text {
  244 + width: 370rpx;
  245 + }
  246 +
  247 + .cu-item {
  248 + background: #3388ff;
  249 + border-radius: 12px;
  250 + width: 120rpx;
  251 + height: 48rpx;
  252 + text-align: center;
  253 + line-height: 40rpx;
  254 +
  255 + text {
  256 + font-size: 12px;
  257 + font-family: PingFangSC-Regular, PingFang SC;
  258 + font-weight: 400;
  259 + color: #ffffff;
  260 + }
  261 + }
  262 +
  263 + .basic-text-status {
  264 + font-size: 14px;
  265 + }
  266 + }
  267 + .detail {
  268 + background-color: #fff;
  269 + margin-top: 30rpx;
  270 + border-radius: 20rpx;
  271 + width: 690rpx;
  272 +
  273 + .detail-item {
  274 + padding: 30rpx;
  275 + display: flex;
  276 + align-items: center;
  277 +
  278 + .detail-label {
  279 + color: #333;
  280 + font-size: 15px;
  281 + }
  282 +
  283 + .detail-value {
  284 + color: #666;
  285 + font-size: 14px;
  286 + margin-left: 30rpx;
  287 + .detail-img{
  288 + width: 60rpx;
  289 + height: 60rpx;
  290 + }
  291 + }
  292 + }
  293 + }
  294 +}
  295 +</style>
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <view class="mt-3">
  6 + <view class="basic-header">
  7 + <view class="u-flex">
  8 + <view class="basic-text text-clip ml-2">
  9 + {{ listDetail.reason }}
  10 + </view>
  11 + <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: faultDevice[listDetail.status].color}">
  12 + {{ listDetail.status ? faultDevice[listDetail.status].name : ''}}
  13 + </view>
  14 + </view>
  15 + </view>
  16 + <view class="detail">
  17 + <view class="detail-item">
  18 + <view class="detail-label">{{ $t('deviceMangement.recordNumber') }}</view>
  19 + <view class="detail-value">{{ listDetail.code}}</view>
  20 + </view>
  21 + <u-line length="90%" margin="0 auto"></u-line>
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceMangement.faultName') }}</view>
  24 + <view class="detail-value">{{ listDetail.reason }}</view>
  25 + </view>
  26 +
  27 + </view>
  28 + </view>
  29 + </view>
  30 +</template>
  31 +
  32 +<script>
  33 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  34 +import api from '@/api/index.js'
  35 +import {faultDevice} from '@/pages/deviceManagement/enum/index.js'
  36 +
  37 +
  38 +export default {
  39 + components: {
  40 + fTabbar,
  41 +
  42 + },
  43 + data() {
  44 + return {
  45 + listDetail:{},
  46 + faultDevice
  47 + };
  48 + },
  49 + onUnload() {
  50 +
  51 + },
  52 + async onLoad(options) {
  53 + // 隐藏原生的tabbar
  54 + uni.hideTabBar();
  55 + if (getApp().getBindNot()) {
  56 + return
  57 + }
  58 + let id = options.id
  59 + const res = await api.deviceManagementApi.getFaultListDetail(id)
  60 + if (!res) return
  61 + this.listDetail = {...res}
  62 +
  63 + },
  64 + onShow(){
  65 + this.$nextTick(()=>{
  66 + uni.setNavigationBarTitle({
  67 + title:this.$t('menu.faultCauseDetail')
  68 + })
  69 + })
  70 +
  71 + },
  72 +
  73 + methods: {
  74 +
  75 +
  76 + },
  77 +};
  78 +</script>
  79 +
  80 +<style lang="scss" scoped>
  81 +.device-detail-page {
  82 + min-height: 100vh;
  83 + background-color: #f8f9fa;
  84 + padding: 0 30rpx;
  85 + .basic-header {
  86 + display: flex;
  87 + justify-content: space-between;
  88 + align-items: center;
  89 + height: 140rpx;
  90 + background-color: #fff;
  91 + border-radius: 20rpx;
  92 + padding-left: 40rpx;
  93 + padding-right:20rpx;
  94 +
  95 + .basic-text {
  96 + width: 370rpx;
  97 + }
  98 +
  99 + .cu-item {
  100 + background: #3388ff;
  101 + border-radius: 12px;
  102 + width: 120rpx;
  103 + height: 48rpx;
  104 + text-align: center;
  105 + line-height: 40rpx;
  106 +
  107 + text {
  108 + font-size: 12px;
  109 + font-family: PingFangSC-Regular, PingFang SC;
  110 + font-weight: 400;
  111 + color: #ffffff;
  112 + }
  113 + }
  114 +
  115 + .basic-text-status {
  116 + font-size: 14px;
  117 + }
  118 + }
  119 + .detail {
  120 + background-color: #fff;
  121 + margin-top: 30rpx;
  122 + border-radius: 20rpx;
  123 + width: 690rpx;
  124 +
  125 + .detail-item {
  126 + padding: 30rpx;
  127 + display: flex;
  128 + align-items: center;
  129 +
  130 + .detail-label {
  131 + color: #333;
  132 + font-size: 15px;
  133 + }
  134 +
  135 + .detail-value {
  136 + color: #666;
  137 + font-size: 14px;
  138 + margin-left: 30rpx;
  139 + }
  140 + }
  141 + }
  142 +}
  143 +</style>
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <view class="mt-3">
  6 + <view class="basic-header">
  7 + <view class="u-flex">
  8 + <view class="basic-text text-clip ml-2">
  9 + {{ listDetail.name }}
  10 + </view>
  11 + <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: faultDevice[listDetail.status].color}">
  12 + {{ listDetail.status ? faultDevice[listDetail.status].name : '' }}
  13 + </view>
  14 + </view>
  15 + </view>
  16 + <view class="detail">
  17 + <view class="detail-item">
  18 + <view class="detail-label">{{ $t('deviceMangement.schemeCode') }}</view>
  19 + <view class="detail-value">{{ listDetail.code}}</view>
  20 + </view>
  21 + <u-line length="90%" margin="0 auto"></u-line>
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceMangement.schemeName') }}</view>
  24 + <view class="detail-value">{{ listDetail.name }}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceMangement.schemeType') }}</view>
  29 + <view class="detail-value">{{ listDetail.type ? schemeType[listDetail.type].name : '' }}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceMangement.schemeDetails') }}</view>
  34 + <view class="detail-value">{{ listDetail.planDetails }}</view>
  35 + </view>
  36 +
  37 + </view>
  38 + </view>
  39 + </view>
  40 +</template>
  41 +
  42 +<script>
  43 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  44 +import api from '@/api/index.js'
  45 +import {faultDevice,schemeType} from '@/pages/deviceManagement/enum/index.js'
  46 +
  47 +
  48 +export default {
  49 + components: {
  50 + fTabbar,
  51 +
  52 + },
  53 + data() {
  54 + return {
  55 + listDetail:{},
  56 + faultDevice,
  57 + schemeType
  58 + };
  59 + },
  60 + onUnload() {
  61 +
  62 + },
  63 + async onLoad(options) {
  64 + // 隐藏原生的tabbar
  65 + uni.hideTabBar();
  66 + if (getApp().getBindNot()) {
  67 + return
  68 + }
  69 + let id = options.id
  70 + const res = await api.deviceManagementApi.getCheckPlanDetail(id)
  71 + if (!res) return
  72 + this.listDetail = {...res}
  73 +
  74 + },
  75 + onShow(){
  76 + this.$nextTick(()=>{
  77 + uni.setNavigationBarTitle({
  78 + title:this.$t('menu.inspectionPlanDetail')
  79 + })
  80 + })
  81 +
  82 + },
  83 +
  84 + methods: {
  85 +
  86 +
  87 + },
  88 +};
  89 +</script>
  90 +
  91 +<style lang="scss" scoped>
  92 +.device-detail-page {
  93 + min-height: 100vh;
  94 + background-color: #f8f9fa;
  95 + padding: 0 30rpx;
  96 + .basic-header {
  97 + display: flex;
  98 + justify-content: space-between;
  99 + align-items: center;
  100 + height: 140rpx;
  101 + background-color: #fff;
  102 + border-radius: 20rpx;
  103 + padding-left: 40rpx;
  104 + padding-right:20rpx;
  105 +
  106 + .basic-text {
  107 + width: 370rpx;
  108 + }
  109 +
  110 + .cu-item {
  111 + background: #3388ff;
  112 + border-radius: 12px;
  113 + width: 120rpx;
  114 + height: 48rpx;
  115 + text-align: center;
  116 + line-height: 40rpx;
  117 +
  118 + text {
  119 + font-size: 12px;
  120 + font-family: PingFangSC-Regular, PingFang SC;
  121 + font-weight: 400;
  122 + color: #ffffff;
  123 + }
  124 + }
  125 +
  126 + .basic-text-status {
  127 + font-size: 14px;
  128 + }
  129 + }
  130 + .detail {
  131 + background-color: #fff;
  132 + margin-top: 30rpx;
  133 + border-radius: 20rpx;
  134 + width: 690rpx;
  135 +
  136 + .detail-item {
  137 + padding: 30rpx;
  138 + display: flex;
  139 + align-items: center;
  140 +
  141 + .detail-label {
  142 + color: #333;
  143 + font-size: 15px;
  144 + }
  145 +
  146 + .detail-value {
  147 + color: #666;
  148 + font-size: 14px;
  149 + margin-left: 30rpx;
  150 + }
  151 + }
  152 + }
  153 +}
  154 +</style>
... ...
  1 +const list = [
  2 + {
  3 + name: 'deviceMangement.basicInfo',
  4 + },
  5 + {
  6 + name: 'deviceMangement.inspectionRecords',
  7 + },
  8 + {
  9 + name: 'deviceMangement.maintenanceRecords',
  10 + },
  11 + {
  12 + name: 'deviceMangement.repairRecords',
  13 + },
  14 +]
  15 +
  16 +const issueStatus = [
  17 + {
  18 + checked: true,
  19 + name: 'common.allText',
  20 + type: '',
  21 + },
  22 + {
  23 + checked: false,
  24 + name: 'device.inQueue',
  25 + type: 'QUEUED',
  26 + },
  27 + {
  28 + checked: false,
  29 + name: 'device.hasBeenSent',
  30 + type: 'SENT',
  31 + },
  32 + {
  33 + checked: false,
  34 + name: 'device.successSent',
  35 + type: 'DELIVERED',
  36 + },
  37 + {
  38 + checked: false,
  39 + name: 'device.responseSuccess',
  40 + type: 'SUCCESSFUL',
  41 + },
  42 + {
  43 + checked: false,
  44 + name: 'device.timeout',
  45 + type: 'TIMEOUT',
  46 + },
  47 + {
  48 + checked: false,
  49 + name: 'device.expired',
  50 + type: 'EXPIRED',
  51 + },
  52 + {
  53 + checked: false,
  54 + name: 'device.ResponseFailed',
  55 + type: 'FAILED',
  56 + },
  57 + {
  58 + checked: false,
  59 + name: 'device.deletedText',
  60 + type: 'DELETED',
  61 + },
  62 +]
  63 +
  64 +const commandTypeList = [
  65 + {
  66 + value: 'OneWay',
  67 + name: 'device.onwWay',
  68 + },
  69 + {
  70 + value: 'TwoWay',
  71 + name: 'device.twoWay',
  72 + },
  73 +]
  74 +
  75 +const deviceTypeNum = {
  76 + GBT: 'GBT28181',
  77 +}
  78 +
  79 +export { list, issueStatus, commandTypeList, deviceTypeNum }
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <u-sticky :bgColor="bgColor">
  6 + <u-tabs :list="list.map(item=>({...item,name:$t(item.name)}))" :current="currentTab" :lineWidth="30" @click=" handleTabClick " :activeStyle="{activeColor}"
  7 + :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:start;height:44px" />
  8 + </u-sticky>
  9 + <view class="mt-3">
  10 + <view class="basic-box" v-show="currentTab == 0">
  11 + <view class="basic-header">
  12 + <view class="u-flex">
  13 + <view class="basic-text text-clip ml-2">
  14 + {{ listDetail.code }}
  15 + </view>
  16 + <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: ledgerType[listDetail.status].color}">
  17 + {{ listDetail.status ? ledgerType[listDetail.status].name : '' }}
  18 + </view>
  19 + </view>
  20 + </view>
  21 + <view class="detail">
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceMangement.deviceCode') }}</view>
  24 + <view class="detail-value">{{ listDetail.code}}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceMangement.deviceName') }}</view>
  29 + <view class="detail-value">{{ listDetail.name }}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceMangement.deviceType') }}</view>
  34 + <view class="detail-value">{{ listDetail.categoryName }}</view>
  35 + </view>
  36 + <u-line length="90%" margin="0 auto"></u-line>
  37 + <view class="detail-item">
  38 + <view class="detail-label">{{ $t('deviceMangement.directorName') }}</view>
  39 + <view class="detail-value">{{ listDetail.directorName }}</view>
  40 + </view>
  41 + <u-line length="90%" margin="0 auto"></u-line>
  42 + <view class="detail-item">
  43 + <view class="detail-label">{{ $t('deviceMangement.brand') }}</view>
  44 + <view class="detail-value">{{ listDetail.brand }}</view>
  45 + </view>
  46 + <u-line length="90%" margin="0 auto"></u-line>
  47 + <view class="detail-item">
  48 + <view class="detail-label">{{ $t('deviceMangement.deviceOnline') }}</view>
  49 + <view class="detail-value">{{ listDetail.isOnline ? '是' :'否' }}</view>
  50 + </view>
  51 + <u-line length="90%" margin="0 auto"></u-line>
  52 + <view class="detail-item">
  53 + <view class="detail-label">{{ $t('deviceMangement.modelNum') }}</view>
  54 + <view class="detail-value">{{ listDetail.modelNum }}</view>
  55 + </view>
  56 + <u-line length="90%" margin="0 auto"></u-line>
  57 + <view class="detail-item">
  58 + <view class="detail-label">{{ $t('deviceMangement.productDate') }}</view>
  59 + <view class="detail-value">{{ listDetail.productDate }}</view>
  60 + </view>
  61 + <u-line length="90%" margin="0 auto"></u-line>
  62 + <view class="detail-item">
  63 + <view class="detail-label">{{ $t('deviceMangement.receiveDate') }}</view>
  64 + <view class="detail-value">{{ listDetail.receiveDate }}</view>
  65 + </view>
  66 + <u-line length="90%" margin="0 auto"></u-line>
  67 + <view class="detail-item">
  68 + <view class="detail-label">{{ $t('deviceMangement.registeDate') }}</view>
  69 + <view class="detail-value">{{ listDetail.registeDate }}</view>
  70 + </view>
  71 + <u-line length="90%" margin="0 auto"></u-line>
  72 + <view class="detail-item">
  73 + <view class="detail-label">{{ $t('deviceMangement.deviceImg') }}</view>
  74 + <view class="detail-value">
  75 + <image class="detail-img" :src="formatImage(listDetail.deviceImg)"/>
  76 + </view>
  77 + </view>
  78 + <u-line length="90%" margin="0 auto"></u-line>
  79 + <view class="detail-item">
  80 + <view class="detail-label">{{ $t('deviceMangement.description') }}</view>
  81 + <view class="detail-value">{{ listDetail.description }}</view>
  82 + </view>
  83 +
  84 + </view>
  85 + </view>
  86 + <view class="record-box" v-show="currentTab == 1">
  87 + <!-- 列表分页 -->
  88 + <mescroll-body ref="mescrollRef" :up="upOption" :down="downOption" @down="downCallback"
  89 + @up="upCallback">
  90 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  91 + <mescroll-empty v-if="!listData.length" />
  92 + </mescroll-body>
  93 + </view>
  94 + <view class="record-box" v-show="currentTab == 2">
  95 + <!-- 列表分页 -->
  96 + <mescroll-body ref="mescrollRef" :up="upOption" :down="downOption" @down="downCallback"
  97 + @up="upCallback">
  98 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  99 + <mescroll-empty v-if="!listData.length" />
  100 + </mescroll-body>
  101 + </view>
  102 + <view class="record-box" v-show="currentTab == 3">
  103 + <!-- 列表分页 -->
  104 + <mescroll-body ref="mescrollRef" :up="upOption" :down="downOption" @down="downCallback"
  105 + @up="upCallback">
  106 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  107 + <mescroll-empty v-if="!listData.length" />
  108 + </mescroll-body>
  109 + </view>
  110 + </view>
  111 + </view>
  112 +</template>
  113 +
  114 +<script>
  115 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  116 +import api from '@/api/index.js'
  117 +import {ledgerType} from '@/pages/deviceManagement/enum/index.js'
  118 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  119 +import baseUrl from '@/config/baseUrl.js'
  120 +import {preserveType,inspectionResult} from '@/pages/deviceInspect/enum/index.js'
  121 +import { list } from './config/data.js'
  122 +import pageList from '@/components/common/page-list'
  123 +
  124 +
  125 +export default {
  126 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  127 + components: {
  128 + fTabbar,
  129 + pageList
  130 +
  131 + },
  132 + data() {
  133 + return {
  134 + bgColor: '#fff',
  135 + activeColor: {
  136 + fontWeight: 'bold',
  137 + color: '#333',
  138 + },
  139 + inActiveColor: {
  140 + color: '#999',
  141 + },
  142 + listDetail:{},
  143 + ledgerType,
  144 + list,
  145 + currentTab: 0,
  146 + isScrollable: false,
  147 + downOption: {
  148 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  149 + },
  150 + upOption: {
  151 + isBounce: false,
  152 + auto: false // 不自动加载
  153 + },
  154 + page: {
  155 + num: 0,
  156 + size: 10
  157 + },
  158 + listData:[],
  159 + };
  160 + },
  161 + onUnload() {
  162 +
  163 + },
  164 + async onLoad(options) {
  165 + // 隐藏原生的tabbar
  166 + uni.hideTabBar();
  167 + if (getApp().getBindNot()) {
  168 + return
  169 + }
  170 + let id = options.id
  171 + const res = await api.deviceManagementApi.getLedgerListDetail(id)
  172 + if (!res) return
  173 + this.listDetail = {...res}
  174 +
  175 + },
  176 + onShow(){
  177 + this.$nextTick(()=>{
  178 + uni.setNavigationBarTitle({
  179 + title:this.$t('menu.deviceLedgerDetail')
  180 + })
  181 + })
  182 +
  183 + },
  184 + watch: {
  185 + currentTab: {
  186 + immediate: true,
  187 + handler(val) {
  188 + this.page.num = 1
  189 + if(val == 1){
  190 + this.loadInspectionData(this.page.num)
  191 + }else if(val == 2){
  192 + this.loadPreserveData(this.page.num);
  193 + }else if(val == 3){
  194 + this.loadRepairData(this.page.num);
  195 + }
  196 +
  197 + }
  198 + },
  199 +
  200 + },
  201 +
  202 + methods: {
  203 + handleTabClick({index}) {
  204 + this.currentTab = index;
  205 + },
  206 +
  207 + formatImage(url) {
  208 + // return baseUrl.baseImgUrl + url
  209 + return window.location.origin + url
  210 + },
  211 +
  212 + //下拉刷新
  213 + downCallback() {
  214 + if (getApp().getBindNot()) {
  215 + setTimeout(() => {
  216 + this.mescroll.endByPage(0, 0)
  217 + }, 200)
  218 + return
  219 + }
  220 + this.listData = [];
  221 + this.page.num = 1;
  222 + if(this.currentTab == 1){
  223 + this.loadInspectionData(this.page.num)
  224 + }else if(this.currentTab == 2){
  225 + this.loadPreserveData(this.page.num);
  226 + }else if(this.currentTab == 3){
  227 + this.loadRepairData(this.page.num);
  228 + }
  229 +
  230 + },
  231 + //上拉加载
  232 + upCallback() {
  233 + if (getApp().getBindNot()) {
  234 + setTimeout(() => {
  235 + this.mescroll.endByPage(0, 0)
  236 + }, 200)
  237 + return
  238 + }
  239 + this.page.num += 1;
  240 + if(this.currentTab == 1){
  241 + this.loadInspectionData(this.page.num)
  242 + }else if(this.currentTab == 2){
  243 + this.loadPreserveData(this.page.num);
  244 + }else if(this.currentTab == 3){
  245 + this.loadRepairData(this.page.num);
  246 + }
  247 + },
  248 +
  249 + //获取巡检记录列表
  250 + async loadInspectionData(pageNo) {
  251 +
  252 + try {
  253 + let httpData = {
  254 + page: pageNo,
  255 + pageSize: 10,
  256 + inspectionPlanId:'',
  257 + inspectorId:'',
  258 + startTime:'',
  259 + endTime:'',
  260 + recordResult:'',
  261 + deviceId:this.listDetail.id
  262 + };
  263 +
  264 + const {
  265 + total,
  266 + items
  267 + } = await api.deviceInspectApi.getPatrolRecordListApi(httpData)
  268 +
  269 + let data = items
  270 +
  271 + let newList = data.map((item)=>{
  272 + return {
  273 + id:item.id,
  274 + title:item.code,
  275 + status:item.recordResult ? inspectionResult[item.recordResult].name : '',
  276 + iconUrl:item.recordResult ? inspectionResult[item.recordResult].iconUrl : '',
  277 + color:item.recordResult ? inspectionResult[item.recordResult].color : '',
  278 + child:[
  279 + {
  280 + label:'deviceInspect.recordCode',
  281 + name:item.code
  282 + },
  283 + {
  284 + label:'deviceInspect.patrolPlan',
  285 + name:item.tkInspectionPlanDTO ? item.tkInspectionPlanDTO.name :''
  286 + },
  287 + {
  288 + label:'deviceInspect.patrolByName',
  289 + name:item.userDTO ? item.userDTO.realName : ''
  290 + },
  291 + {
  292 + label:'deviceInspect.checkDate',
  293 + name:item.checkDate
  294 + },
  295 + ],
  296 + detail:{
  297 + ...item
  298 + }
  299 + }
  300 + })
  301 + uni.stopPullDownRefresh();
  302 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  303 + if (pageNo == 1) {
  304 + this.listData = newList;
  305 + } else {
  306 + this.listData = this.listData.concat(newList);
  307 + }
  308 +
  309 +
  310 + } catch {
  311 + this.mescroll.endErr();
  312 + }
  313 + },
  314 +
  315 + //获取保养记录列表
  316 + async loadPreserveData(pageNo) {
  317 +
  318 + try {
  319 + let httpData = {
  320 + page: pageNo,
  321 + pageSize: 10,
  322 + };
  323 + const httpPostData = {
  324 + startDate:'', //开始时间
  325 + endDate:'', //结束时间
  326 + preservePlanId:'', //保养计划id
  327 + preserveBy:'', //保养人id
  328 + preserveStatus:'', //状态
  329 + deviceId:this.listDetail.id, //设备id
  330 + deviceName:'',
  331 + preservePlanName:'',
  332 + }
  333 + const {
  334 + total,
  335 + items
  336 + } = await api.deviceInspectApi.getMaintenanceRecordListApi(httpData, httpPostData)
  337 +
  338 + let data = items
  339 +
  340 + let newList = data.map((item)=>{
  341 + return {
  342 + id:item.id,
  343 + title:item.recordCode,
  344 + status:item.preserveStatus ? preserveType[item.preserveStatus].name : '',
  345 + iconUrl:item.preserveStatus ? preserveType[item.preserveStatus].iconUrl : '',
  346 + color:item.preserveStatus ? preserveType[item.preserveStatus].color : '',
  347 + child:[
  348 + {
  349 + label:'deviceInspect.preserveDate',
  350 + name:item.preserveDate
  351 + },
  352 + {
  353 + label:'deviceInspect.preserveByName',
  354 + name:item.preserveByName
  355 + },
  356 + {
  357 + label:'deviceInspect.preserveStatus',
  358 + name:item.preserveStatus ? preserveType[item.preserveStatus].name :''
  359 + }
  360 +
  361 + ],
  362 + detail:{
  363 + ...item
  364 + }
  365 + }
  366 + })
  367 + uni.stopPullDownRefresh();
  368 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  369 + if (pageNo == 1) {
  370 + this.listData = newList;
  371 + } else {
  372 + this.listData = this.listData.concat(newList);
  373 + }
  374 +
  375 +
  376 + } catch {
  377 + this.mescroll.endErr();
  378 + }
  379 + },
  380 +
  381 + //获取维修记录列表
  382 + async loadRepairData(pageNo,params={}) {
  383 + try {
  384 + let httpData = {
  385 + page: pageNo,
  386 + pageSize: 10,
  387 + };
  388 + const httpPostData = {
  389 + orderCode:'', //工单id
  390 + reportBy:'', //报修人id
  391 + repairBy:'', //维修人id
  392 + deviceId:this.listDetail.id, //设备id
  393 + ...params
  394 + }
  395 + const {
  396 + total,
  397 + items
  398 + } = await api.deviceRepairApi.getRepairRecordApi(httpData, httpPostData)
  399 +
  400 + let data = items
  401 + let newList = data.map((item)=>{
  402 + return {
  403 + id:item.id,
  404 + title:item.code,
  405 + child:[
  406 + {
  407 + label:'deviceRepair.code',
  408 + name:item.code
  409 + },
  410 + {
  411 + label:'deviceRepair.repairDate',
  412 + name:item.repairDate
  413 + },
  414 + {
  415 + label:'deviceRepair.repairName',
  416 + name:item.repairName
  417 + },
  418 + {
  419 + label:'deviceRepair.malfunctionReasonName',
  420 + name:item.malfunctionReasonName
  421 + },
  422 + {
  423 + label:'deviceRepair.repairDescription',
  424 + name:item.description
  425 + }
  426 +
  427 + ],
  428 + detail:{
  429 + ...item
  430 + }
  431 + }
  432 + })
  433 + uni.stopPullDownRefresh();
  434 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  435 + if (pageNo == 1) {
  436 + this.listData = newList;
  437 + } else {
  438 + this.listData = this.listData.concat(newList);
  439 + }
  440 +
  441 +
  442 + } catch {
  443 + this.mescroll.endErr();
  444 + }
  445 + },
  446 +
  447 +
  448 + },
  449 +};
  450 +</script>
  451 +
  452 +<style lang="scss" scoped>
  453 +.device-detail-page {
  454 + min-height: 100vh;
  455 + background-color: #f8f9fa;
  456 + // padding: 0 30rpx;
  457 + .mt-3{
  458 + margin-top: 0;
  459 + .basic-box{
  460 + margin-top: 30rpx;
  461 + padding: 0 30rpx;
  462 + }
  463 + }
  464 + .basic-header {
  465 + display: flex;
  466 + justify-content: space-between;
  467 + align-items: center;
  468 + height: 140rpx;
  469 + background-color: #fff;
  470 + border-radius: 20rpx;
  471 + padding-left: 40rpx;
  472 + padding-right:20rpx;
  473 +
  474 + .basic-text {
  475 + width: 370rpx;
  476 + }
  477 +
  478 + .cu-item {
  479 + background: #3388ff;
  480 + border-radius: 12px;
  481 + width: 120rpx;
  482 + height: 48rpx;
  483 + text-align: center;
  484 + line-height: 40rpx;
  485 +
  486 + text {
  487 + font-size: 12px;
  488 + font-family: PingFangSC-Regular, PingFang SC;
  489 + font-weight: 400;
  490 + color: #ffffff;
  491 + }
  492 + }
  493 +
  494 + .basic-text-status {
  495 + font-size: 14px;
  496 + }
  497 + }
  498 + .detail {
  499 + background-color: #fff;
  500 + margin-top: 30rpx;
  501 + border-radius: 20rpx;
  502 + width: 690rpx;
  503 +
  504 + .detail-item {
  505 + padding: 30rpx;
  506 + display: flex;
  507 + align-items: center;
  508 +
  509 + .detail-label {
  510 + color: #333;
  511 + font-size: 15px;
  512 + }
  513 +
  514 + .detail-value {
  515 + color: #666;
  516 + font-size: 14px;
  517 + margin-left: 30rpx;
  518 + .detail-img{
  519 + width: 60rpx;
  520 + height: 60rpx;
  521 + }
  522 + }
  523 + }
  524 + }
  525 +}
  526 +</style>
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <view class="mt-3">
  6 + <view class="basic-header">
  7 + <view class="u-flex">
  8 + <view class="basic-text text-clip ml-2">
  9 + {{ listDetail.code }}
  10 + </view>
  11 + <!-- <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: faultDevice[listDetail.status].color}">
  12 + {{ listDetail.status ? faultDevice[listDetail.status].name : ''}}
  13 + </view> -->
  14 + </view>
  15 + </view>
  16 + <view class="detail">
  17 + <view class="detail-item">
  18 + <view class="detail-label">{{ $t('deviceRepair.code') }}</view>
  19 + <view class="detail-value">{{ listDetail.code}}</view>
  20 + </view>
  21 + <u-line length="90%" margin="0 auto"></u-line>
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceRepair.orderCodeName') }}</view>
  24 + <view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.orderCode : '' }}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceRepair.repairDevice') }}</view>
  29 + <view class="detail-value">{{ listDetail.deviceAccountName }}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceRepair.reportDate') }}</view>
  34 + <view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.reportDate : '' }}</view>
  35 + </view>
  36 + <u-line length="90%" margin="0 auto"></u-line>
  37 + <view class="detail-item">
  38 + <view class="detail-label">{{ $t('deviceRepair.reportByName') }}</view>
  39 + <view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.reportByName :'' }}</view>
  40 + </view>
  41 + <u-line length="90%" margin="0 auto"></u-line>
  42 + <view class="detail-item">
  43 + <view class="detail-label">{{ $t('deviceRepair.situationImg') }}</view>
  44 + <view class="detail-value">
  45 + <image class="detail-img" v-if="listDetail.tkRepairOrderDTO" :src="formatImage(listDetail.tkRepairOrderDTO.situationImg)"/>
  46 + </view>
  47 + </view>
  48 + <u-line length="90%" margin="0 auto"></u-line>
  49 + <view class="detail-item">
  50 + <view class="detail-label">{{ $t('deviceRepair.description') }}</view>
  51 + <view class="detail-value">{{ listDetail.tkRepairOrderDTO ? listDetail.tkRepairOrderDTO.description : ''}}</view>
  52 + </view>
  53 + <u-line length="90%" margin="0 auto"></u-line>
  54 + <view class="detail-item">
  55 + <view class="detail-label">{{ $t('deviceRepair.repairDate') }}</view>
  56 + <view class="detail-value">{{ listDetail.repairDate }}</view>
  57 + </view>
  58 + <u-line length="90%" margin="0 auto"></u-line>
  59 + <view class="detail-item">
  60 + <view class="detail-label">{{ $t('deviceRepair.repairName') }}</view>
  61 + <view class="detail-value">{{ listDetail.repairName }}</view>
  62 + </view>
  63 + <u-line length="90%" margin="0 auto"></u-line>
  64 + <view class="detail-item">
  65 + <view class="detail-label">{{ $t('deviceRepair.malfunctionReasonName') }}</view>
  66 + <view class="detail-value">{{ listDetail.malfunctionReasonName }}</view>
  67 + </view>
  68 + <u-line length="90%" margin="0 auto"></u-line>
  69 + <view class="detail-item">
  70 + <view class="detail-label">{{ $t('deviceRepair.repairDescription') }}</view>
  71 + <view class="detail-value">{{ listDetail.description }}</view>
  72 + </view>
  73 +
  74 + </view>
  75 + </view>
  76 + </view>
  77 +</template>
  78 +
  79 +<script>
  80 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  81 +import api from '@/api/index.js'
  82 +import {faultDevice} from '@/pages/deviceManagement/enum/index.js'
  83 +import baseUrl from '@/config/baseUrl.js'
  84 +
  85 +
  86 +export default {
  87 + components: {
  88 + fTabbar,
  89 +
  90 + },
  91 + data() {
  92 + return {
  93 + listDetail:{},
  94 + faultDevice
  95 + };
  96 + },
  97 + onUnload() {
  98 +
  99 + },
  100 + async onLoad(options) {
  101 + // 隐藏原生的tabbar
  102 + uni.hideTabBar();
  103 + if (getApp().getBindNot()) {
  104 + return
  105 + }
  106 + let id = options.id
  107 + const res = await api.deviceRepairApi.getRepairRecordDetail(id)
  108 + if (!res) return
  109 + this.listDetail = {...res}
  110 +
  111 + },
  112 + onShow(){
  113 + this.$nextTick(()=>{
  114 + uni.setNavigationBarTitle({
  115 + title:this.$t('menu.repairRecordDetail')
  116 + })
  117 + })
  118 +
  119 + },
  120 +
  121 + methods: {
  122 + formatImage(url) {
  123 + // return baseUrl.baseImgUrl + url
  124 + return window.location.origin + url
  125 + },
  126 +
  127 +
  128 + },
  129 +};
  130 +</script>
  131 +
  132 +<style lang="scss" scoped>
  133 +.device-detail-page {
  134 + min-height: 100vh;
  135 + background-color: #f8f9fa;
  136 + padding: 0 30rpx;
  137 + .basic-header {
  138 + display: flex;
  139 + justify-content: space-between;
  140 + align-items: center;
  141 + height: 140rpx;
  142 + background-color: #fff;
  143 + border-radius: 20rpx;
  144 + padding-left: 40rpx;
  145 + padding-right:20rpx;
  146 +
  147 + .basic-text {
  148 + width: 370rpx;
  149 + }
  150 +
  151 + .cu-item {
  152 + background: #3388ff;
  153 + border-radius: 12px;
  154 + width: 120rpx;
  155 + height: 48rpx;
  156 + text-align: center;
  157 + line-height: 40rpx;
  158 +
  159 + text {
  160 + font-size: 12px;
  161 + font-family: PingFangSC-Regular, PingFang SC;
  162 + font-weight: 400;
  163 + color: #ffffff;
  164 + }
  165 + }
  166 +
  167 + .basic-text-status {
  168 + font-size: 14px;
  169 + }
  170 + }
  171 + .detail {
  172 + background-color: #fff;
  173 + margin-top: 30rpx;
  174 + border-radius: 20rpx;
  175 + width: 690rpx;
  176 +
  177 + .detail-item {
  178 + padding: 30rpx;
  179 + display: flex;
  180 + align-items: center;
  181 +
  182 + .detail-label {
  183 + color: #333;
  184 + font-size: 15px;
  185 + }
  186 +
  187 + .detail-value {
  188 + color: #666;
  189 + font-size: 14px;
  190 + margin-left: 30rpx;
  191 + .detail-img{
  192 + width: 60rpx;
  193 + height: 60rpx;
  194 + }
  195 + }
  196 + }
  197 + }
  198 +}
  199 +</style>
... ...
  1 +const list = [
  2 + {
  3 + name: 'deviceRepair.basicInfo',
  4 + },
  5 + {
  6 + name: 'deviceRepair.repairRecord',
  7 + }
  8 +]
  9 +
  10 +
  11 +export { list }
... ...
  1 +<template>
  2 + <view class="device-detail-page">
  3 + <!-- 公共组件-每个页面必须引入 -->
  4 + <public-module></public-module>
  5 + <u-sticky :bgColor="bgColor">
  6 + <u-tabs :list="list.map(item=>({...item,name:$t(item.name)}))" :current="currentTab" :lineWidth="30" @click=" handleTabClick " :activeStyle="{activeColor}"
  7 + :inactiveStyle="inActiveColor" :scrollable="isScrollable" itemStyle="padding: 0 11px;display:flex;flex-direction:row;align-items:center;justify-content:center;height:44px" />
  8 + </u-sticky>
  9 + <view class="mt-3">
  10 + <view class="basic-box" v-show="currentTab == 0">
  11 + <view class="basic-header">
  12 + <view class="u-flex">
  13 + <view class="basic-text text-clip ml-2">
  14 + {{ listDetail.orderCode }}
  15 + </view>
  16 + <view v-if="listDetail.status" class="basic-text-status ml-2" :style="{ color: repairType[listDetail.status].color}">
  17 + {{ listDetail.status ? repairType[listDetail.status].name : '' }}
  18 + </view>
  19 + </view>
  20 + </view>
  21 + <view class="detail">
  22 + <view class="detail-item">
  23 + <view class="detail-label">{{ $t('deviceRepair.orderCode') }}</view>
  24 + <view class="detail-value">{{ listDetail.orderCode}}</view>
  25 + </view>
  26 + <u-line length="90%" margin="0 auto"></u-line>
  27 + <view class="detail-item">
  28 + <view class="detail-label">{{ $t('deviceRepair.device') }}</view>
  29 + <view class="detail-value">{{ listDetail.deviceInfo ? listDetail.deviceInfo.name : '' }}</view>
  30 + </view>
  31 + <u-line length="90%" margin="0 auto"></u-line>
  32 + <view class="detail-item">
  33 + <view class="detail-label">{{ $t('deviceRepair.brand') }}</view>
  34 + <view class="detail-value">{{ listDetail.deviceInfo ? listDetail.deviceInfo.brand : '' }}</view>
  35 + </view>
  36 + <u-line length="90%" margin="0 auto"></u-line>
  37 + <view class="detail-item">
  38 + <view class="detail-label">{{ $t('deviceRepair.modelNum') }}</view>
  39 + <view class="detail-value">{{ listDetail.deviceInfo ? listDetail.deviceInfo.modelNum :'' }}</view>
  40 + </view>
  41 + <u-line length="90%" margin="0 auto"></u-line>
  42 + <view class="detail-item">
  43 + <view class="detail-label">{{ $t('deviceRepair.specifications') }}</view>
  44 + <view class="detail-value">{{ listDetail.deviceInfo ? listDetail.deviceInfo.specifications :'' }}</view>
  45 + </view>
  46 + <u-line length="90%" margin="0 auto"></u-line>
  47 + <view class="detail-item">
  48 + <view class="detail-label">{{ $t('deviceRepair.reportDate') }}</view>
  49 + <view class="detail-value">{{ listDetail.reportDate }}</view>
  50 + </view>
  51 + <u-line length="90%" margin="0 auto"></u-line>
  52 + <view class="detail-item">
  53 + <view class="detail-label">{{ $t('deviceRepair.directorName') }}</view>
  54 + <view class="detail-value">{{ listDetail.deviceInfo ? listDetail.deviceInfo.directorName : '' }}</view>
  55 + </view>
  56 + <u-line length="90%" margin="0 auto"></u-line>
  57 + <view class="detail-item">
  58 + <view class="detail-label">{{ $t('deviceRepair.reportByName') }}</view>
  59 + <view class="detail-value">{{ listDetail.reportByName }}</view>
  60 + </view>
  61 + <u-line length="90%" margin="0 auto"></u-line>
  62 + <view class="detail-item">
  63 + <view class="detail-label">{{ $t('deviceRepair.emergency') }}</view>
  64 + <view class="detail-value">{{ listDetail.emergency ? '是' :'否' }}</view>
  65 + </view>
  66 + <u-line length="90%" margin="0 auto"></u-line>
  67 + <view class="detail-item">
  68 + <view class="detail-label">{{ $t('deviceRepair.situationImg') }}</view>
  69 + <view class="detail-value">
  70 + <image class="detail-img" v-if="listDetail.situationImg" :src="formatImage(listDetail.situationImg)"/>
  71 + </view>
  72 + </view>
  73 + <u-line length="90%" margin="0 auto"></u-line>
  74 + <view class="detail-item">
  75 + <view class="detail-label">{{ $t('deviceMangement.description') }}</view>
  76 + <view class="detail-value">{{ listDetail.description }}</view>
  77 + </view>
  78 +
  79 + </view>
  80 + </view>
  81 + <view class="record-box" v-show="currentTab == 1">
  82 + <!-- 列表分页 -->
  83 + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback"
  84 + @up="upCallback">
  85 + <page-list :list="listData" @openDeviceDetail="openDeviceDetail"></page-list>
  86 + <mescroll-empty v-if="!listData.length" />
  87 + </mescroll-body>
  88 + </view>
  89 +
  90 + </view>
  91 + </view>
  92 +</template>
  93 +
  94 +<script>
  95 +import fTabbar from "@/components/module/f-tabbar/f-tabbar";
  96 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  97 +import api from '@/api/index.js'
  98 +import {repairType} from '@/pages/deviceRepair/enum/index.js'
  99 +import { list } from './config/data.js'
  100 +import baseUrl from '@/config/baseUrl.js'
  101 +import pageList from '@/components/common/page-list'
  102 +
  103 +
  104 +export default {
  105 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  106 + components: {
  107 + fTabbar,
  108 + pageList
  109 +
  110 + },
  111 + data() {
  112 + return {
  113 + bgColor: '#fff',
  114 + activeColor: {
  115 + fontWeight: 'bold',
  116 + color: '#333',
  117 + },
  118 + inActiveColor: {
  119 + color: '#999',
  120 + },
  121 + listDetail:{},
  122 + list,
  123 + currentTab: 0,
  124 + isScrollable: false,
  125 + repairType,
  126 + downOption: {
  127 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  128 + },
  129 + upOption: {
  130 + isBounce: false,
  131 + auto: false // 不自动加载
  132 + },
  133 + page: {
  134 + num: 0,
  135 + size: 10
  136 + },
  137 + orderCode:'', //工单id
  138 + reportBy:'', //报修人id
  139 + repairBy:'', //维修人id
  140 + deviceId:'', //设备id,
  141 + listData:[]
  142 +
  143 + };
  144 + },
  145 + onUnload() {
  146 +
  147 + },
  148 + async onLoad(options) {
  149 + // 隐藏原生的tabbar
  150 + uni.hideTabBar();
  151 + if (getApp().getBindNot()) {
  152 + return
  153 + }
  154 + let id = options.id
  155 + const res = await api.deviceRepairApi.getRepairWorkDetail(id)
  156 + if (!res) return
  157 + this.listDetail = {...res}
  158 +
  159 +
  160 + },
  161 + onShow(){
  162 + this.$nextTick(()=>{
  163 + uni.setNavigationBarTitle({
  164 + title:this.$t('menu.repairWorkOrderDetail')
  165 + })
  166 + })
  167 +
  168 +
  169 + },
  170 + watch: {
  171 + currentTab: {
  172 + immediate: true,
  173 + handler(val) {
  174 + if(val == 1){
  175 + this.page.num = 1
  176 + this.loadData(this.page.num);
  177 + }
  178 +
  179 + }
  180 + },
  181 +
  182 +
  183 +
  184 + },
  185 +
  186 + methods: {
  187 + handleTabClick({index}) {
  188 + this.currentTab = index;
  189 + },
  190 +
  191 + formatImage(url) {
  192 + // return baseUrl.baseImgUrl + url
  193 + return window.location.origin + url
  194 + },
  195 + //下拉刷新
  196 + downCallback() {
  197 + if (getApp().getBindNot()) {
  198 + setTimeout(() => {
  199 + this.mescroll.endByPage(0, 0)
  200 + }, 200)
  201 + return
  202 + }
  203 + this.listData = [];
  204 + this.page.num = 1;
  205 + this.loadData(this.page.num);
  206 + this.resetQuery();
  207 + },
  208 + //上拉加载
  209 + upCallback() {
  210 + if (getApp().getBindNot()) {
  211 + setTimeout(() => {
  212 + this.mescroll.endByPage(0, 0)
  213 + }, 200)
  214 + return
  215 + }
  216 + this.page.num += 1;
  217 + this.loadData(this.page.num);
  218 + },
  219 + //获取列表
  220 + async loadData(pageNo,params={}) {
  221 + try {
  222 + let httpData = {
  223 + page: pageNo,
  224 + pageSize: 10,
  225 + };
  226 + const httpPostData = {
  227 + orderCode:this.listDetail.orderCode, //工单id
  228 + reportBy:this.reportBy, //报修人id
  229 + repairBy:this.repairBy, //维修人id
  230 + deviceId:this.deviceId, //设备id
  231 + deviceName:'',
  232 + ...params
  233 + }
  234 + const {
  235 + total,
  236 + items
  237 + } = await api.deviceRepairApi.getRepairRecordApi(httpData, httpPostData)
  238 +
  239 + let data = items
  240 + let newList = data.map((item)=>{
  241 + return {
  242 + id:item.id,
  243 + title:item.code,
  244 + child:[
  245 + {
  246 + label:'deviceRepair.code',
  247 + name:item.code
  248 + },
  249 + {
  250 + label:'deviceRepair.repairDate',
  251 + name:item.repairDate
  252 + },
  253 + {
  254 + label:'deviceRepair.repairName',
  255 + name:item.repairName
  256 + },
  257 + {
  258 + label:'deviceRepair.malfunctionReasonName',
  259 + name:item.malfunctionReasonName
  260 + },
  261 + {
  262 + label:'deviceRepair.repairDescription',
  263 + name:item.description
  264 + }
  265 +
  266 + ],
  267 + detail:{
  268 + ...item
  269 + }
  270 + }
  271 + })
  272 + uni.stopPullDownRefresh();
  273 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  274 + if (pageNo == 1) {
  275 + this.listData = newList;
  276 + } else {
  277 + this.listData = this.listData.concat(newList);
  278 + }
  279 +
  280 +
  281 + } catch {
  282 + this.mescroll.endErr();
  283 + }
  284 + },
  285 +
  286 +
  287 + },
  288 +};
  289 +</script>
  290 +
  291 +<style lang="scss" scoped>
  292 +.device-detail-page {
  293 + min-height: 100vh;
  294 + background-color: #f8f9fa;
  295 + // padding: 0 30rpx;
  296 + .mt-3{
  297 + // padding: 0 30rpx;
  298 + margin-top: 0;
  299 + .basic-box{
  300 + margin-top: 30rpx;
  301 + padding: 0 30rpx;
  302 + }
  303 + .record-box{
  304 + // padding: 0 30rpx 0 15rpx;
  305 + }
  306 + }
  307 + .basic-header {
  308 + display: flex;
  309 + justify-content: space-between;
  310 + align-items: center;
  311 + height: 140rpx;
  312 + background-color: #fff;
  313 + border-radius: 20rpx;
  314 + padding-left: 40rpx;
  315 + padding-right:20rpx;
  316 +
  317 +
  318 + .basic-text {
  319 + width: 370rpx;
  320 + }
  321 +
  322 + .cu-item {
  323 + background: #3388ff;
  324 + border-radius: 12px;
  325 + width: 120rpx;
  326 + height: 48rpx;
  327 + text-align: center;
  328 + line-height: 40rpx;
  329 +
  330 + text {
  331 + font-size: 12px;
  332 + font-family: PingFangSC-Regular, PingFang SC;
  333 + font-weight: 400;
  334 + color: #ffffff;
  335 + }
  336 + }
  337 +
  338 + .basic-text-status {
  339 + font-size: 14px;
  340 + }
  341 + }
  342 + .detail {
  343 + background-color: #fff;
  344 + margin-top: 30rpx;
  345 + border-radius: 20rpx;
  346 + width: 690rpx;
  347 +
  348 + .detail-item {
  349 + padding: 30rpx;
  350 + display: flex;
  351 + align-items: center;
  352 +
  353 + .detail-label {
  354 + color: #333;
  355 + font-size: 15px;
  356 + }
  357 +
  358 + .detail-value {
  359 + color: #666;
  360 + font-size: 14px;
  361 + margin-left: 30rpx;
  362 + .detail-img{
  363 + width: 60rpx;
  364 + height: 60rpx;
  365 + }
  366 + }
  367 + }
  368 + }
  369 +}
  370 +</style>
... ...
... ... @@ -21,5 +21,8 @@
21 21 "personalData": "Personal data",
22 22 "phoneLogin": "Mobile verification code login",
23 23 "forgotPassword": "Forgot password",
24   - "my": "mine"
  24 + "my": "mine",
  25 + "deviceLedger":"Device Ledger",
  26 + "faultCause":"Fault Cause",
  27 + "faultCauseDetail":"Fault Cause Detail"
25 28 }
... ...
  1 +export default {
  2 + pleasePlanName:'Please Plan Name',
  3 + preserveCode:'Preserve Code',
  4 + preserveName:'Preserve Name',
  5 + status:'Status',
  6 + frequency:'Frequency',
  7 + times:'Times',
  8 + preserveRecord:'Preserve Record',
  9 + basicInfo:'BasicInfo',
  10 + recordCode:'RecordCode',
  11 + preserveDate:'PreserveDate',
  12 + preserveByName:'PreserveByName',
  13 + preserveStatus:'PreserveStatus',
  14 + preservePlanName:'PreservePlanName',
  15 + pleasePreservePlanName:'Please preserve plan name',
  16 + preserveDetail:'Preserve Detail',
  17 + checkPlanName:'Check Plan Name',
  18 + startTime:'StartTime',
  19 + endTime:'EndTime',
  20 + patrolRecord:'PatrolRecord',
  21 + patrolPlan:'PatrolPlan',
  22 + checkDate:'CheckDate',
  23 + pleasePatrolPlanName:'Please patrol plan name',
  24 + patrolByName:'PatrolByName',
  25 + patrolDetail:'PatrolDetail',
  26 + patrolDevice:'PatrolDevice',
  27 + patrolContent:'PatrolContent',
  28 + checkResult:'CheckResult'
  29 +}
... ...
  1 +export default {
  2 + pleaseEnterFaultName:'Please enter fault name',
  3 + faultName:'Fault Name',
  4 + recordNumber:'Record Number',
  5 + schemeCode:'Scheme Code',
  6 + schemeName:'Scheme Name',
  7 + schemeType:'Scheme Type',
  8 + schemeDetails:'Scheme Details',
  9 + pleaseEnterSchemeName:'Please enter scheme name',
  10 + pleaseEnterDeviceCode: 'Please enter device code',
  11 + deviceName:'Device Name',
  12 + deviceCode:'Device Code',
  13 + deviceType:'Device Type',
  14 + brand:'Brand',
  15 + directorName:'Director Name',
  16 + basicInfo:'Basic Info',
  17 + inspectionRecords:'Inspection Records',
  18 + maintenanceRecords:'Maintenance Records',
  19 + repairRecords:'Repair Records',
  20 + deviceOnline:'Device Online',
  21 + modelNum:'Model Num',
  22 + productDate:'Product Date',
  23 + receiveDate:'Receive Date',
  24 + registeDate:'Registe Date',
  25 + deviceImg:'Device Img',
  26 + description:'Description'
  27 +}
... ...
  1 +export default {
  2 + orderCode: 'Order Code',
  3 + device:'Device',
  4 + brand:'Brand',
  5 + modelNum:'Model Num',
  6 + specifications:'Specifications',
  7 + reportDate:'Report Date',
  8 + reportByName: 'ReportByName',
  9 + status: 'Status',
  10 + emergency:'Emergency',
  11 + situationImg:'SituationImg',
  12 + description:'Description',
  13 + directorName:'Director Name',
  14 + pleaseDeviceName:'Please device name',
  15 + repairRecord:'Repair Record',
  16 + basicInfo:'BasicInfo',
  17 + code:'Code',
  18 + repairDate:'Repair Date',
  19 + repairName:'Repair Name',
  20 + malfunctionReasonName:'Malfunction ReasonName',
  21 + repairDescription:'Repair Description',
  22 + orderCodeName:'OrderCode Name',
  23 + repairDevice:'Repair Device',
  24 + pleaseOrderCodeName:'Please OrderCode Name',
  25 +}
... ...
... ... @@ -6,7 +6,10 @@ import menu from './menu'
6 6 import components from './components'
7 7 import alarm from './alarm'
8 8 import userCenter from './userCenter'
  9 +import deviceMangement from './deviceMangement'
  10 +import deviceRepair from './deviceRepair'
  11 +import deviceInspect from './deviceInspect'
9 12 export default {
10   - homePage, common, login, device, menu, components, alarm, userCenter,
  13 + homePage, common, login, device, menu, components, alarm, userCenter,deviceMangement,deviceRepair,deviceInspect,
11 14 spreadTail: 'Connecting the world to create value'
12 15 }
... ...
... ... @@ -22,5 +22,22 @@ export default {
22 22 personalData: 'Personal data',
23 23 phoneLogin: 'Mobile verification code login',
24 24 forgotPassword: 'Forgot password',
25   - my: 'mine'
  25 + my: 'mine',
  26 + deviceLedger:"Device Ledger",
  27 + deviceLedgerDetail:'Device Ledger Detail',
  28 + faultCause:"Fault Cause",
  29 + faultCauseDetail:"Fault Cause Detail",
  30 + inspectionPlanDetail:'Inspection Plan Detail',
  31 + repairWorkOrder:'Repair WorkOrder',
  32 + repairWorkOrderDetail:'Repair WorkOrder Detail',
  33 + repairRecord:'Repair Record',
  34 + repairRecordDetail:'Repair Record Detail',
  35 + maintenancePlan:'Maintenance Plan',
  36 + maintenancePlanDetail:'Maintenance Plan Detail',
  37 + maintenanceRecord:'Maintenance Record',
  38 + maintenanceRecordDetail:'Maintenance Record Detail',
  39 + patrolPlan:'Patrol Plan',
  40 + patrolPlanDetail:'Patrol Plan Detail',
  41 + patrolRecord:'Patrol Record',
  42 + patrolRecordDetail:'Patrol Record Detail'
26 43 }
... ...
... ... @@ -88,5 +88,5 @@ export default {
88 88 issuanceStatus: '下发状态',
89 89 commandTime: '命令下发时间',
90 90 responseResults: '响应结果',
91   - commandContent: '命令内容',
  91 + commandContent: '命令内容'
92 92 }
... ...
  1 +export default {
  2 + pleasePlanName:'请输入计划名称',
  3 + preserveCode:'计划编号',
  4 + preserveName:'计划名称',
  5 + status:'状态',
  6 + frequency:'维护频率',
  7 + times:'维护次数',
  8 + preserveRecord:'保养记录',
  9 + basicInfo:'基本信息',
  10 + recordCode:'记录编号',
  11 + preserveDate:'保养日期',
  12 + preserveByName:'保养人员',
  13 + preserveStatus:'维护结果',
  14 + preservePlanName:'保养计划',
  15 + pleasePreservePlanName:'请输入保养计划名称',
  16 + preserveDetail:'保养明细',
  17 + checkPlanName:'方案名称',
  18 + startTime:'开始日期',
  19 + endTime:'结束日期',
  20 + patrolRecord:'巡检记录',
  21 + patrolPlan:'巡检计划',
  22 + checkDate:'巡检日期',
  23 + pleasePatrolPlanName:'请输入巡检计划名称',
  24 + patrolByName:'巡检人',
  25 + patrolDetail:'巡检明细',
  26 + patrolDevice:'巡检设备',
  27 + patrolContent:'巡检内容',
  28 + checkResult:'检查结果'
  29 +}
... ...
  1 +export default {
  2 + pleaseEnterFaultName: '请输入故障名称',
  3 + faultName:'故障名称',
  4 + recordNumber:'记录编号',
  5 + schemeCode:'方案编号',
  6 + schemeName:'方案名称',
  7 + schemeType:'方案类型',
  8 + schemeDetails:'方案明细',
  9 + pleaseEnterSchemeName: '请输入方案名称',
  10 + pleaseEnterDeviceCode: '请输入设备编码',
  11 + deviceName:'设备名称',
  12 + deviceCode:'设备编码',
  13 + deviceType:'设备类型',
  14 + brand:'品牌',
  15 + directorName:'负责人',
  16 + basicInfo:'基本信息',
  17 + inspectionRecords:'巡检记录',
  18 + maintenanceRecords:'保养记录',
  19 + repairRecords:'维修记录' ,
  20 + deviceOnline:'设备联网',
  21 + modelNum:'型号',
  22 + productDate:'出厂日期',
  23 + receiveDate:'验收日期',
  24 + registeDate:'登记日期',
  25 + deviceImg:'图片',
  26 + description:'备注'
  27 +}
... ...
  1 +export default {
  2 + orderCode: '维修单编号',
  3 + device:'设备',
  4 + brand:'品牌',
  5 + modelNum:'型号',
  6 + specifications:'规格',
  7 + reportDate:'报修时间',
  8 + reportByName: '报修人员',
  9 + status: '状态',
  10 + emergency:'是否紧急',
  11 + situationImg:'故障详情拍照',
  12 + description:'故障描述',
  13 + directorName:'设备负责人',
  14 + pleaseDeviceName:'请输入设备名称',
  15 + repairRecord:'维修记录',
  16 + basicInfo:'基本信息',
  17 + code:'记录编号',
  18 + repairDate:'维修时间',
  19 + repairName:'维修人员',
  20 + malfunctionReasonName:'故障原因',
  21 + repairDescription:'维修情况说明',
  22 + orderCodeName:'维修工单',
  23 + repairDevice:'维修设备',
  24 + pleaseOrderCodeName:'请输入维修工单名称',
  25 +
  26 +
  27 +}
... ...
... ... @@ -6,7 +6,11 @@ import menu from './menu'
6 6 import components from './components'
7 7 import alarm from './alarm'
8 8 import userCenter from './userCenter'
  9 +import deviceMangement from './deviceMangement'
  10 +import deviceRepair from './deviceRepair'
  11 +import deviceInspect from './deviceInspect'
  12 +
9 13 export default {
10   - homePage, common, login, device, menu, components, alarm, userCenter,
  14 + homePage, common, login, device, menu, components, alarm, userCenter,deviceMangement,deviceRepair,deviceInspect,
11 15 spreadTail: '连接世界 创造价值',
12 16 }
... ...
... ... @@ -23,4 +23,22 @@ export default {
23 23 phoneLogin: '手机验证码登录',
24 24 forgotPassword: '忘记密码',
25 25 my: "我的",
  26 + deviceLedger:'设备台账',
  27 + deviceLedgerDetail:'设备台账详情',
  28 + faultCause:'故障原因管理',
  29 + faultCauseDetail:'故障原因管理详情',
  30 + inspectionPlan:'巡检/保养方案',
  31 + inspectionPlanDetail:'巡检/保养方案详情',
  32 + repairWorkOrder:'维修工单',
  33 + repairWorkOrderDetail:'维修工单详情',
  34 + repairRecord:'维修记录',
  35 + repairRecordDetail:'维修记录详情',
  36 + maintenancePlan:'保养计划',
  37 + maintenancePlanDetail:'保养计划详情',
  38 + maintenanceRecord:'保养记录',
  39 + maintenanceRecordDetail:'保养记录详情',
  40 + patrolPlan:'巡检计划',
  41 + patrolPlanDetail:'巡检计划详情',
  42 + patrolRecord:'巡检记录',
  43 + patrolRecordDetail:'巡检记录详情'
26 44 }
... ...
... ... @@ -21,5 +21,9 @@
21 21 "personalData": "个人资料",
22 22 "phoneLogin": "手机验证码登录",
23 23 "forgotPassword": "忘记密码",
24   - "my": "我的"
  24 + "my": "我的",
  25 + "deviceLedger":"设备台账",
  26 + "faultCause":"故障原因管理",
  27 + "faultCauseDetail":"故障原因管理详情",
  28 + "inspectionPlan":"巡检/保养方案"
25 29 }
... ...
... ... @@ -10,6 +10,7 @@
10 10 "license": "ISC",
11 11 "dependencies": {
12 12 "moment": "^2.29.2",
  13 + "uview-ui": "^2.0.38",
13 14 "vue-i18n": "^9.1.9"
14 15 }
15 16 },
... ... @@ -372,6 +373,14 @@
372 373 "node": ">=4"
373 374 }
374 375 },
  376 + "node_modules/uview-ui": {
  377 + "version": "2.0.38",
  378 + "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.38.tgz",
  379 + "integrity": "sha512-6egHDf9lXHKpG3hEjRE0vMx4+VWwKk/ReTf5x18KrIKqdvdPRqO3+B8Unh7vYYwrIxzAWIlmhZ9RJpKI/4UqPQ==",
  380 + "engines": {
  381 + "HBuilderX": "^3.1.0"
  382 + }
  383 + },
375 384 "node_modules/vue": {
376 385 "version": "3.5.11",
377 386 "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.11.tgz",
... ...
... ... @@ -13,6 +13,7 @@
13 13 "license": "ISC",
14 14 "dependencies": {
15 15 "moment": "^2.29.2",
  16 + "uview-ui": "^2.0.38",
16 17 "vue-i18n": "^9.1.9"
17 18 }
18 19 }
... ...
... ... @@ -91,7 +91,70 @@
91 91 "style": {
92 92 "navigationBarTitleText": ""
93 93 }
  94 + },
  95 + {
  96 + "path": "pages/deviceManagement/ledger/ledger",
  97 + "style": {
  98 + "navigationBarTitleText": ""
  99 + }
  100 + },
  101 + {
  102 + "path": "pages/deviceManagement/deviceType/deviceType",
  103 + "style": {
  104 + "navigationBarTitleText": ""
  105 + }
  106 + },
  107 + {
  108 + "path": "pages/deviceManagement/faultCause/faultCause",
  109 + "style": {
  110 + "navigationBarTitleText": ""
  111 + }
  112 + },
  113 + {
  114 + "path": "pages/deviceManagement/inspectionPlan/inspectionPlan",
  115 + "style": {
  116 + "navigationBarTitleText": ""
  117 + }
  118 + },
  119 + {
  120 + "path": "pages/deviceRepair/repairWorkOrder/repairWorkOrder",
  121 + "style": {
  122 + "navigationBarTitleText": ""
  123 + }
  124 + },
  125 + {
  126 + "path": "pages/deviceRepair/repairRecord/repairRecord",
  127 + "style": {
  128 + "navigationBarTitleText": ""
  129 + }
  130 + },
  131 + {
  132 + "path": "pages/deviceInspect/maintenancePlan/maintenancePlan",
  133 + "style": {
  134 + "navigationBarTitleText": ""
  135 + }
  136 + },
  137 + {
  138 + "path": "pages/deviceInspect/maintenanceRecord/maintenanceRecord",
  139 + "style": {
  140 + "navigationBarTitleText": ""
  141 + }
  142 + },
  143 + {
  144 + "path": "pages/deviceInspect/patrolPlan/patrolPlan",
  145 + "style": {
  146 + "navigationBarTitleText": ""
  147 + }
  148 + },
  149 + {
  150 + "path": "pages/deviceInspect/patrolRecord/patrolRecord",
  151 + "style": {
  152 + "navigationBarTitleText": ""
  153 + }
94 154 }
  155 +
  156 +
  157 +
95 158 ],
96 159 "subPackages": [{
97 160 "root": "alarm-subpackage",
... ... @@ -184,7 +247,76 @@
184 247 }
185 248 }
186 249 ]
  250 + },
  251 + {
  252 + "root": "deviceManagement-subpackage",
  253 + "pages": [{
  254 + "path": "faultCause-detail/faultCause-detail",
  255 + "style": {
  256 + "navigationBarTitleText": ""
  257 + }
  258 + },
  259 + {
  260 + "path": "inspectionPlan-detail/inspectionPlan-detail",
  261 + "style": {
  262 + "navigationBarTitleText": ""
  263 + }
  264 + },
  265 + {
  266 + "path": "ledger-detail/ledger-detail",
  267 + "style": {
  268 + "navigationBarTitleText": ""
  269 + }
  270 + }
  271 + ]
  272 + },
  273 + {
  274 + "root": "deviceRepair-subpackage",
  275 + "pages": [{
  276 + "path": "repairWorkOrder-detail/repairWorkOrder-detail",
  277 + "style": {
  278 + "navigationBarTitleText": ""
  279 + }
  280 + },
  281 + {
  282 + "path": "repairRecord-detail/repairRecord-detail",
  283 + "style": {
  284 + "navigationBarTitleText": ""
  285 + }
  286 + }
  287 +
  288 + ]
  289 + },
  290 + {
  291 + "root": "deviceInspect-subpackage",
  292 + "pages": [{
  293 + "path": "maintenancePlan-detail/maintenancePlan-detail",
  294 + "style": {
  295 + "navigationBarTitleText": ""
  296 + }
  297 + },
  298 + {
  299 + "path": "maintenanceRecord-detail/maintenanceRecord-detail",
  300 + "style": {
  301 + "navigationBarTitleText": ""
  302 + }
  303 + },
  304 + {
  305 + "path": "patrolPlan-detail/patrolPlan-detail",
  306 + "style": {
  307 + "navigationBarTitleText": ""
  308 + }
  309 + },
  310 + {
  311 + "path": "patrolRecord-detail/patrolRecord-detail",
  312 + "style": {
  313 + "navigationBarTitleText": ""
  314 + }
  315 + }
  316 +
  317 + ]
187 318 }
  319 +
188 320 ],
189 321 "globalStyle": {
190 322 "navigationBarTextStyle": "black",
... ...
  1 +const planType = {
  2 + 'NOTSTART':{
  3 + color:'#666666',
  4 + name:'未开始',
  5 + iconUrl:'/static/unonline.png'
  6 + },
  7 + 'UNDERWAY':{
  8 + color:'#FFD700',
  9 + name:'进行中',
  10 + iconUrl:'/static/time.png'
  11 + },
  12 + 'COMPLETED':{
  13 + color:'#377DFF',
  14 + name:'已完成',
  15 + iconUrl:'/static/online.png'
  16 + },
  17 + 'STOP':{
  18 + color:'#DE4437',
  19 + name:'停用',
  20 + iconUrl:'/static/baojing.png'
  21 + }
  22 +}
  23 +
  24 +const preserveType = {
  25 + 'INCOMPLETE':{
  26 + color:'#666666',
  27 + name:'未完成',
  28 + iconUrl:'/static/unonline.png'
  29 + },
  30 + 'COMPLETE':{
  31 + color:'#377DFF',
  32 + name:'已完成',
  33 + iconUrl:'/static/online.png'
  34 + }
  35 +}
  36 +
  37 +const detailType = {
  38 + 'UNEXECUTED':{
  39 + color:'#666666',
  40 + name:'未执行',
  41 + iconUrl:'/static/unonline.png'
  42 + },
  43 + 'EXECUTED':{
  44 + color:'#377DFF',
  45 + name:'已执行',
  46 + iconUrl:'/static/online.png'
  47 + }
  48 +}
  49 +
  50 +
  51 +const inspectionType = {
  52 + 'NOT_START':{
  53 + color:'#666666',
  54 + name:'未开始',
  55 + iconUrl:'/static/unonline.png'
  56 + },
  57 + 'UNDERWAY':{
  58 + color:'#FFD700',
  59 + name:'进行中',
  60 + iconUrl:'/static/time.png'
  61 + },
  62 + 'FINISH':{
  63 + color:'#377DFF',
  64 + name:'已完成',
  65 + iconUrl:'/static/online.png'
  66 + },
  67 + 'STOP':{
  68 + color:'#DE4437',
  69 + name:'停用',
  70 + iconUrl:'/static/baojing.png'
  71 + }
  72 +}
  73 +
  74 +const inspectionResult = {
  75 + true:{
  76 + color:'#377DFF',
  77 + name:'正常',
  78 + iconUrl:'/static/online.png'
  79 +
  80 + },
  81 + false:{
  82 + color:'#DE4437',
  83 + name:'异常',
  84 + iconUrl:'/static/baojing.png'
  85 + }
  86 +}
  87 +
  88 +
  89 +
  90 +
  91 +export {
  92 + planType,
  93 + preserveType,
  94 + detailType,
  95 + inspectionType,
  96 + inspectionResult
  97 +}
... ...
  1 +<template>
  2 + <view class="faultCause-page">
  3 + <!-- 头部 -->
  4 + <header-searchNoOrg @openSearchDialog="openSearchDialog">
  5 + <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 -->
  6 + <u--input prefixIcon="search" :placeholder="$t('deviceInspect.pleasePlanName')" shape="circle"
  7 + @change="inputChanged">
  8 + </u--input>
  9 + </header-searchNoOrg>
  10 + <!-- 列表分页 -->
  11 + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback"
  12 + @up="upCallback">
  13 + <page-list :list="list" @openDeviceDetail="openDeviceDetail"></page-list>
  14 + <mescroll-empty v-if="!list.length" />
  15 + </mescroll-body>
  16 + <view style="height: 20rpx"></view>
  17 + <!-- 筛选 -->
  18 + <filter-popup ref="devicePopupRef" :filterList="filterList" :filterName="filterName" :show="show" @close="close" @queryCondition="getQueryCondition" ></filter-popup>
  19 + </view>
  20 +</template>
  21 +
  22 +<script>
  23 +import headerSearchNoOrg from '@/components/common/header-searchNoOrg.vue';
  24 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  25 +import api from '@/api/index.js'
  26 +import {
  27 + useNavigateTo
  28 +} from '@/plugins/utils.js'
  29 +import pageList from '@/components/common/page-list'
  30 +import filterPopup from '@/components/common/filter-popup.vue'
  31 +import {planType} from '../enum/index.js'
  32 +
  33 +export default {
  34 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  35 + components: {
  36 + pageList,
  37 + filterPopup,
  38 + headerSearchNoOrg
  39 + },
  40 + data() {
  41 + return {
  42 + downOption: {
  43 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  44 + },
  45 + upOption: {
  46 + isBounce: false,
  47 + auto: false // 不自动加载
  48 + },
  49 + show: false,
  50 + list: [],
  51 + page: {
  52 + num: 0,
  53 + size: 10
  54 + },
  55 + preserveName:'',//保养计划名称
  56 + status:'', //状态
  57 + filterName:{ //筛选的字段
  58 + status:''
  59 + },
  60 + filterList:[ //筛选弹框字段
  61 + {
  62 + title:'状态',
  63 + titleCode:'status',
  64 + typeList:[
  65 + {
  66 + checked:true,
  67 + name:'全部',
  68 + code:''
  69 + },
  70 + {
  71 + checked:false,
  72 + name:'未开始',
  73 + code:'NOTSTART'
  74 + },
  75 + {
  76 + checked:false,
  77 + name:'进行中',
  78 + code:'UNDERWAY'
  79 + },
  80 + {
  81 + checked:false,
  82 + name:'已完成',
  83 + code:'COMPLETED'
  84 + },
  85 + {
  86 + checked:false,
  87 + name:'停用',
  88 + code:'STOP'
  89 + }
  90 + ]
  91 + },
  92 +
  93 + ]
  94 +
  95 + };
  96 + },
  97 + onLoad(e) {
  98 + // 隐藏原生的tabbar
  99 + uni.hideTabBar();
  100 + if (getApp().getBindNot()) {
  101 + return
  102 + }
  103 + },
  104 + onShow() {
  105 + this.$nextTick(()=>{
  106 + uni.setNavigationBarTitle({
  107 + title:this.$t('menu.maintenancePlan')
  108 + })
  109 + })
  110 + if (getApp().getBindNot()) {
  111 + return
  112 + }
  113 + this.page.num = 1
  114 + this.loadData(this.page.num);
  115 + },
  116 + methods: {
  117 +
  118 + //输入框查询
  119 + inputChanged(e) {
  120 + if (getApp().getBindNot()) {
  121 + return
  122 + }
  123 + this.page.num = 1;
  124 + this.preserveName = e;
  125 + this.loadData(1);
  126 + },
  127 + //筛选弹窗重置操作
  128 + resetQuery() {
  129 + this.$refs.devicePopupRef.resetFilter()
  130 + this.status = ''
  131 + },
  132 + //筛选弹窗确认操作
  133 + getQueryCondition(value) {
  134 + this.page.num = 1;
  135 + this.status = value.status
  136 + this.loadData(this.page.num, value);
  137 + this.close()
  138 + },
  139 + //下拉刷新
  140 + downCallback() {
  141 + if (getApp().getBindNot()) {
  142 + setTimeout(() => {
  143 + this.mescroll.endByPage(0, 0)
  144 + }, 200)
  145 + return
  146 + }
  147 + this.list = [];
  148 + this.page.num = 1;
  149 + this.loadData(this.page.num);
  150 + this.resetQuery();
  151 + },
  152 + //上拉加载
  153 + upCallback() {
  154 + if (getApp().getBindNot()) {
  155 + setTimeout(() => {
  156 + this.mescroll.endByPage(0, 0)
  157 + }, 200)
  158 + return
  159 + }
  160 + this.page.num += 1;
  161 + this.loadData(this.page.num);
  162 + },
  163 + //获取列表
  164 + async loadData(pageNo,params={}) {
  165 + try {
  166 + let httpData = {
  167 + page: pageNo,
  168 + pageSize: 10,
  169 + };
  170 + const httpPostData = {
  171 + preserveName:this.preserveName,
  172 + status:this.status,
  173 + ...params
  174 + }
  175 + const {
  176 + total,
  177 + items
  178 + } = await api.deviceInspectApi.getMaintenancePlanListApi(httpData, httpPostData)
  179 +
  180 + let data = items
  181 + let newList = data.map((item)=>{
  182 + return {
  183 + id:item.id,
  184 + title:item.preserveCode,
  185 + status:item.status ? planType[item.status].name : '',
  186 + iconUrl:item.status ? planType[item.status].iconUrl : '',
  187 + color:item.status ? planType[item.status].color : '',
  188 + child:[
  189 + {
  190 + label:'deviceInspect.preserveName',
  191 + name:item.preserveName
  192 + },
  193 + {
  194 + label:'deviceInspect.frequency',
  195 + name:item.frequency
  196 + },
  197 + {
  198 + label:'deviceInspect.times',
  199 + name:item.times
  200 + },
  201 + ],
  202 + detail:{
  203 + ...item
  204 + }
  205 + }
  206 + })
  207 + uni.stopPullDownRefresh();
  208 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  209 + if (pageNo == 1) {
  210 + this.list = newList;
  211 + } else {
  212 + this.list = this.list.concat(newList);
  213 + }
  214 +
  215 +
  216 + } catch {
  217 + this.mescroll.endErr();
  218 + }
  219 + },
  220 +
  221 + //打开筛选弹框
  222 + openSearchDialog() {
  223 + if (getApp().getBindNot()) {
  224 + uni.$u.toast(this.$t('deviceMangement.pleaseBindAccount'))
  225 + return
  226 + }
  227 + this.show = true;
  228 + },
  229 +
  230 + //关闭筛选弹框
  231 + close() {
  232 + this.show = false;
  233 + },
  234 +
  235 + //列表详情
  236 + openDeviceDetail(values) {
  237 + const { id } = values || {}
  238 + uni.navigateTo({
  239 + url: `/deviceInspect-subpackage/maintenancePlan-detail/maintenancePlan-detail?id=${id}`
  240 + });
  241 + },
  242 + }
  243 +};
  244 +</script>
  245 +
  246 +<style lang="scss" scoped>
  247 +.faultCause-page {
  248 + min-height: 100vh;
  249 + background-color: #f8f9fa;
  250 +}
  251 +
  252 +.device-top {
  253 + padding: 10rpx 30rpx;
  254 + background-color: #fff;
  255 +
  256 + .search {
  257 + display: flex;
  258 + justify-content: space-between;
  259 + padding-bottom: 10rpx;
  260 +
  261 + .search-left {
  262 + width: 580rpx;
  263 + background-color: #f8f9fa;
  264 + border-radius: 200rpx;
  265 + }
  266 +
  267 + .search-right {
  268 + display: flex;
  269 + align-items: center;
  270 +
  271 + text {
  272 + color: #333;
  273 + font-size: 14px;
  274 + }
  275 +
  276 + image {
  277 + width: 40rpx;
  278 + height: 40rpx;
  279 + }
  280 + }
  281 + }
  282 +}
  283 +</style>
... ...
  1 +<template>
  2 + <view class="faultCause-page">
  3 + <!-- 头部 -->
  4 + <header-searchNoOrg @openSearchDialog="openSearchDialog">
  5 + <!-- 不能写在封装组件里传placeholder,mp-wenxin端编译要报错 -->
  6 + <u--input prefixIcon="search" :placeholder="$t('deviceInspect.pleasePreservePlanName')" shape="circle"
  7 + @change="inputChanged">
  8 + </u--input>
  9 + </header-searchNoOrg>
  10 + <!-- 列表分页 -->
  11 + <mescroll-body ref="mescrollRef" @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback"
  12 + @up="upCallback">
  13 + <page-list :list="list" @openDeviceDetail="openDeviceDetail"></page-list>
  14 + <mescroll-empty v-if="!list.length" />
  15 + </mescroll-body>
  16 + <view style="height: 20rpx"></view>
  17 + <!-- 筛选 -->
  18 + <filter-popup ref="devicePopupRef" :filterList="filterList" :filterName="filterName" :show="show" @close="close" @queryCondition="getQueryCondition" ></filter-popup>
  19 + </view>
  20 +</template>
  21 +
  22 +<script>
  23 +import headerSearchNoOrg from '@/components/common/header-searchNoOrg.vue';
  24 +import MescrollMixin from '@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js';
  25 +import api from '@/api/index.js'
  26 +import {
  27 + useNavigateTo
  28 +} from '@/plugins/utils.js'
  29 +import pageList from '@/components/common/page-list'
  30 +import filterPopup from '@/components/common/filter-popup.vue'
  31 +import {planType,preserveType} from '../enum/index.js'
  32 +
  33 +export default {
  34 + mixins: [MescrollMixin], // 使用mixin (在main.js注册全局组件)
  35 + components: {
  36 + pageList,
  37 + filterPopup,
  38 + headerSearchNoOrg
  39 + },
  40 + data() {
  41 + return {
  42 + downOption: {
  43 + auto: false //是否在初始化后,自动执行downCallback; 默认true
  44 + },
  45 + upOption: {
  46 + isBounce: false,
  47 + auto: false // 不自动加载
  48 + },
  49 + show: false,
  50 + list: [],
  51 + page: {
  52 + num: 0,
  53 + size: 10
  54 + },
  55 + startDate:'', //开始时间
  56 + endDate:'', //结束时间
  57 + preservePlanId:'', //保养计划id
  58 + preservePlanName:'', //保养计划名称
  59 + preserveBy:'', //保养人id
  60 + preserveStatus:'', //状态
  61 + deviceId:'', //设备id
  62 + deviceName:'', //设备名称
  63 + filterName:{ //筛选的字段
  64 + preserveStatus:'',
  65 + startDate:'',
  66 + endDate:''
  67 + },
  68 + filterList:[ //筛选弹框字段
  69 + {
  70 + title:'维护结果',
  71 + titleCode:'preserveStatus',
  72 + typeList:[
  73 + {
  74 + checked:true,
  75 + name:'全部',
  76 + code:''
  77 + },
  78 + {
  79 + checked:false,
  80 + name:'未完成',
  81 + code:'INCOMPLETE'
  82 + },
  83 + {
  84 + checked:false,
  85 + name:'已完成',
  86 + code:'COMPLETE'
  87 + }
  88 + ]
  89 + },
  90 + {
  91 + title:'保养日期',
  92 + isDate:true,
  93 + startDate:'startDate',
  94 + endDate:'endDate',
  95 + range:[]
  96 + }
  97 +
  98 + ]
  99 +
  100 + };
  101 + },
  102 + onLoad(e) {
  103 + // 隐藏原生的tabbar
  104 + uni.hideTabBar();
  105 + if (getApp().getBindNot()) {
  106 + return
  107 + }
  108 + },
  109 + onShow() {
  110 + this.$nextTick(()=>{
  111 + uni.setNavigationBarTitle({
  112 + title:this.$t('menu.maintenanceRecord')
  113 + })
  114 + })
  115 + if (getApp().getBindNot()) {
  116 + return
  117 + }
  118 + this.page.num = 1
  119 + this.loadData(this.page.num);
  120 + },
  121 + methods: {
  122 +
  123 + //输入框查询
  124 + inputChanged(e) {
  125 + if (getApp().getBindNot()) {
  126 + return
  127 + }
  128 + this.page.num = 1;
  129 + this.preservePlanName = e;
  130 + this.loadData(1);
  131 + },
  132 + //筛选弹窗重置操作
  133 + resetQuery() {
  134 + this.$refs.devicePopupRef.resetFilter()
  135 + this.preserveStatus = ''
  136 + this.startDate = ''
  137 + this.endDate = ''
  138 + },
  139 + //筛选弹窗确认操作
  140 + getQueryCondition(value) {
  141 + this.page.num = 1;
  142 + this.preserveStatus = value.preserveStatus
  143 + this.startDate = value.startDate
  144 + this.endDate = value.endDate
  145 + this.loadData(this.page.num, value);
  146 + this.close()
  147 + },
  148 + //下拉刷新
  149 + downCallback() {
  150 + if (getApp().getBindNot()) {
  151 + setTimeout(() => {
  152 + this.mescroll.endByPage(0, 0)
  153 + }, 200)
  154 + return
  155 + }
  156 + this.list = [];
  157 + this.page.num = 1;
  158 + this.loadData(this.page.num);
  159 + this.resetQuery();
  160 + },
  161 + //上拉加载
  162 + upCallback() {
  163 + if (getApp().getBindNot()) {
  164 + setTimeout(() => {
  165 + this.mescroll.endByPage(0, 0)
  166 + }, 200)
  167 + return
  168 + }
  169 + this.page.num += 1;
  170 + this.loadData(this.page.num);
  171 + },
  172 + //获取列表
  173 + async loadData(pageNo,params={}) {
  174 + try {
  175 + let httpData = {
  176 + page: pageNo,
  177 + pageSize: 10,
  178 + };
  179 + const httpPostData = {
  180 + startDate:this.startDate, //开始时间
  181 + endDate:this.endDate, //结束时间
  182 + preservePlanId:this.preservePlanId, //保养计划id
  183 + preservePlanName:this.preservePlanName, //保养计划名称
  184 + preserveBy:this.preserveBy, //保养人id
  185 + preserveStatus:this.preserveStatus, //状态
  186 + deviceId:this.deviceId, //设备id
  187 + deviceName:this.deviceName,//设备名称
  188 + ...params
  189 + }
  190 + const {
  191 + total,
  192 + items
  193 + } = await api.deviceInspectApi.getMaintenanceRecordListApi(httpData, httpPostData)
  194 +
  195 + let data = items
  196 + let newList = data.map((item)=>{
  197 + return {
  198 + id:item.id,
  199 + title:item.recordCode,
  200 + status:item.preserveStatus ? preserveType[item.preserveStatus].name : '',
  201 + iconUrl:item.preserveStatus ? preserveType[item.preserveStatus].iconUrl : '',
  202 + color:item.preserveStatus ? preserveType[item.preserveStatus].color : '',
  203 + child:[
  204 + {
  205 + label:'deviceInspect.preserveDate',
  206 + name:item.preserveDate
  207 + },
  208 + {
  209 + label:'deviceInspect.preserveByName',
  210 + name:item.preserveByName
  211 + },
  212 + {
  213 + label:'deviceInspect.preservePlanName',
  214 + name:item.preservePlanName
  215 + }
  216 +
  217 + ],
  218 + detail:{
  219 + ...item
  220 + }
  221 + }
  222 + })
  223 + uni.stopPullDownRefresh();
  224 + this.mescroll.endByPage(items.length); //必传参数(当前页的数据个数, 总页数)
  225 + if (pageNo == 1) {
  226 + this.list = newList;
  227 + } else {
  228 + this.list = this.list.concat(newList);
  229 + }
  230 +
  231 +
  232 + } catch {
  233 + this.mescroll.endErr();
  234 + }
  235 + },
  236 +
  237 + //打开筛选弹框
  238 + openSearchDialog() {
  239 + if (getApp().getBindNot()) {
  240 + uni.$u.toast(this.$t('deviceMangement.pleaseBindAccount'))
  241 + return
  242 + }
  243 + this.show = true;
  244 + },
  245 +
  246 + //关闭筛选弹框
  247 + close() {
  248 + this.show = false;
  249 + },
  250 +
  251 + //列表详情
  252 + openDeviceDetail(values) {
  253 + const { id } = values || {}
  254 + uni.navigateTo({
  255 + url: `/deviceInspect-subpackage/maintenanceRecord-detail/maintenanceRecord-detail?id=${id}`
  256 + });
  257 + },
  258 + }
  259 +};
  260 +</script>
  261 +
  262 +<style lang="scss" scoped>
  263 +.faultCause-page {
  264 + min-height: 100vh;
  265 + background-color: #f8f9fa;
  266 +}
  267 +
  268 +.device-top {
  269 + padding: 10rpx 30rpx;
  270 + background-color: #fff;
  271 +
  272 + .search {
  273 + display: flex;
  274 + justify-content: space-between;
  275 + padding-bottom: 10rpx;
  276 +
  277 + .search-left {
  278 + width: 580rpx;
  279 + background-color: #f8f9fa;
  280 + border-radius: 200rpx;
  281 + }
  282 +
  283 + .search-right {
  284 + display: flex;
  285 + align-items: center;
  286 +
  287 + text {
  288 + color: #333;
  289 + font-size: 14px;
  290 + }
  291 +
  292 + image {
  293 + width: 40rpx;
  294 + height: 40rpx;
  295 + }
  296 + }
  297 + }
  298 +}
  299 +</style>
... ...