Explorar o código

refactor(upload): 优化图片上传组件数据同步和展示

- 新增内部维护的原始图片数据列表,避免并行上传导致丢图
- 增加展示数据转换方法,实现相对路径转完整地址
- 删除图片时同步删除原始数据,确保数据一致性
- 上传完成后回传原始文件实体,触发父组件更新和列表刷新
- 调整watch逻辑,通过内部数据同步展示数据,优化组件刷新机制

style(equipment-detail): 优化设备详情页样式和结构

- 调整布局格式,规范模板代码风格
- 简化部分注释和无用代码,提升代码可读性
- 修正跳转页面路径,统一命名规范
- 增加状态样式的padding和圆角
- 精简常用操作区组件结构,保持代码一致

fix(maintain-ignore): 调整保养忽略页任务操作状态逻辑

- 与PC端保持一致,仅未接收状态可接收任务
- 仅执行中状态可完成任务,移除多余的状态判断
- 规范代码格式并统一事件绑定方式

refactor(maintain): 改进保养任务页数据展示
408249787@qq.com hai 1 día
pai
achega
82315a14e1

+ 33 - 26
components/m-upload-img/index.vue

@@ -1,6 +1,7 @@
 <template>
   <view>
-    <uni-file-picker @select="select" mode="grid" @delete="deletefile" v-model="fileList" :limit="maxSize" file-mediatype="image" :image-styles="imageStyles"></uni-file-picker>
+    <uni-file-picker @select="select" mode="grid" @delete="deletefile" v-model="fileList" :limit="maxSize"
+      file-mediatype="image" :image-styles="imageStyles"></uni-file-picker>
   </view>
 </template>
 
@@ -10,6 +11,8 @@ export default {
   data() {
     return {
       fileList: [],
+      // 提交用原始数据(相对路径);组件内维护,避免并行上传时 prop 回传延迟导致丢图
+      innerList: [],
       imageStyles: {
         width: 100,
         height: 100,
@@ -34,36 +37,38 @@ export default {
   watch: {
     value: {
       deep: true,
-      // immediate: true,
       handler: function (newV) {
         // 数据为空的三种情况
         if (newV === null || newV === '' || newV === undefined) {
           this.fileList = []
-          this.isWatch = true
+          this.innerList = []
           return
         }
-        // if (this.isWatch) {
-        //   this.isWatch = false
-        //   if (newV.length > 0) {
-
-        // #ifndef H5
-        this.fileList = this.$BaseTool.UserUtil.transImg(newV)
-        // #endif
-        // #ifdef H5
-        this.fileList = newV
-        // #endif
-        //   } else {
-        //     this.isWatch = true
-        //   }
-        // }
+        // 同步内部数据源,再转展示数据;新数组引用才能触发 uni-file-picker 刷新
+        this.innerList = newV
+        this.fileList = this.toDisplayList(newV)
       }
     }
   },
   methods: {
+    // 生成展示数据:相对路径转完整地址;克隆处理,不修改提交用的原始数据,避免重复拼接前缀
+    toDisplayList(list) {
+      return (list || []).map(item => {
+        const data = Object.assign({}, item)
+        if (data.url && data.url.substr(0, 4) !== 'http') {
+          data.url = this.$BaseTool.UserUtil.getFileUrl(data.url)
+        }
+        return data
+      })
+    },
     deletefile(e) {
-      this.fileList = this.fileList.filter(item => item.path !== e.tempFilePath)
-      this.$emit('input', this.fileList)
-      this.$emit('change', this.fileList)
+      // e.tempFilePath 为展示用的完整地址,按原始 url 后缀匹配,同步删除提交数据中的对应项
+      const newValue = (this.innerList || []).filter(item => {
+        return !(item.url && e.tempFilePath && e.tempFilePath.endsWith(item.url))
+      })
+      this.innerList = newValue
+      this.$emit('input', newValue)
+      this.$emit('change', newValue)
     },
     select(e) {
       // 根据所选图片的个数,多次调用上传函数
@@ -73,7 +78,7 @@ export default {
         const promise = this.uploadFiles(e.tempFilePaths, i)
         promises.push(promise)
       }
-      Promise.all(promises).then(() => {})
+      Promise.all(promises).then(() => { })
     },
     // 上传函数
     async uploadFiles(tempFilePaths, i) {
@@ -91,9 +96,12 @@ export default {
           if (reg.test(res.data.fileName)) {
             uni.showToast({ icon: 'none', title: '文件名包含非法字符!' })
           } else {
-            that.fileList.push(data.data)
-            this.$emit('input', this.fileList)
-            that.$emit('change', that.fileList)
+            // 回传原始文件实体(相对路径),保证提交数据不变;
+            // 新数组引用触发父组件更新 -> watch 转为展示数据 -> 列表刷新展示
+            const newValue = (that.innerList || []).concat([data.data])
+            that.innerList = newValue
+            that.$emit('input', newValue)
+            that.$emit('change', newValue)
           }
         },
         fail: () => {
@@ -105,5 +113,4 @@ export default {
 }
 </script>
 
-<style>
-</style>
+<style></style>

+ 42 - 69
pages/equipment-detail/equipment-detail.vue

@@ -4,26 +4,20 @@
         <view class="d-flex px3 py2">
             <view class="top d-flex a-center bg-color-white flex1 one-ellipsis">
                 <view class="img" style="cursor:pointer">
-                    <image
-                        :src="
-                            imgSrc
-                                ? imgSrc
-                                : $BaseTool.UserUtil.getFileUrl(infoData.qrCode)
-                        "
-                        mode="widthFix"
-                    ></image>
+                    <image :src="imgSrc
+                            ? imgSrc
+                            : $BaseTool.UserUtil.getFileUrl(infoData.qrCode)
+                        " mode="widthFix"></image>
                 </view>
                 <view class="pl-3">
                     <view class="f-size-36 text-color-3 one-ellipsis">{{
                         infoData.name
-                    }}</view>
-                    <view
-                        class="d-flex f-size-28 f-weight-6 f-wrap"
-                        style="margin: 20rpx 0"
-                    >
+                        }}</view>
+                    <view class="d-flex f-size-28 f-weight-6 f-wrap" style="margin: 20rpx 0">
                     </view>
                     <view class="d-flex">
-                        <text class="f-size-26 mr-3 state-r main-color-bg text-color-white">{{ statusMap[infoData.status] }}</text>
+                        <text class="f-size-26 mr-3 state-r main-color-bg text-color-white">{{
+                            statusMap[infoData.status] }}</text>
                     </view>
                 </view>
             </view>
@@ -31,14 +25,8 @@
         <view class="divider"></view>
         <!-- 基本信息 -->
         <view class="mt-3 px3">
-            <view
-                class="f-size-30 f-weight-bold py2 border-bottom"
-            >基本信息</view
-            >
-            <view
-                class="mx3 my2 p3 bg-color-white"
-                style="border-radius: 16rpx; border: 1px solid #eee"
-            >
+            <view class="f-size-30 f-weight-bold py2 border-bottom">基本信息</view>
+            <view class="mx3 my2 p3 bg-color-white" style="border-radius: 16rpx; border: 1px solid #eee">
                 <equipment-line title="设备编号" :content="infoData.no" />
                 <!--                <equipment-line title="财务编码" :content="infoData.financingNo"/>-->
                 <equipment-line title="设备类型" :content="infoData.typeName" />
@@ -136,16 +124,10 @@
         </view>
         <view class="divider"></view>
         <view class="px3">
-            <view
-                class="f-size-30 f-weight-bold py2 border-bottom"
-            >常用操作</view
-            >
+            <view class="f-size-30 f-weight-bold py2 border-bottom">常用操作</view>
             <u-grid :col="3" :border="false">
                 <u-grid-item @tap="handleAdd(1)">
-                    <view
-                        class="iconfont icon-baoxiu"
-                        style="color: #0f6fb9"
-                    ></view>
+                    <view class="iconfont icon-baoxiu" style="color: #0f6fb9"></view>
                     <view class="grid-text">报修</view>
                 </u-grid-item>
                 <!--                <u-grid-item @tap="handleAdd(2)">
@@ -172,10 +154,7 @@
         </view>
         <view class="divider"></view>
         <view class="px3">
-            <my-card
-                title="设备图片"
-                @handleLubrication="handleImg"
-            ></my-card>
+            <my-card title="设备图片" @handleLubrication="handleImg"></my-card>
         </view>
         <!-- <view class="divider"></view>
                <view class="px3">
@@ -208,39 +187,31 @@
                 :tipNum="gatherTask.lubricationTaskWeek"
                 @handleLubrication="handleMaintain(2)"
             ></my-card> -->
-            <my-card
-                icon="icon-tubiaozhizuomoban-135"
-                title="本月保养任务"
-                :tipNum="gatherTask.lubricationTaskMonth"
-                @handleLubrication="handleMaintain(3)"
-            ></my-card>
-<!--            <my-card-->
-<!--                v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
-<!--                icon="icon-tubiaozhizuomoban-135"-->
-<!--                title="今日保养任务"-->
-<!--                :tipNum="gatherTask.lubricationTaskMyDay"-->
-<!--                @handleLubrication="handleMaintainAll(0,1)"-->
-<!--            ></my-card>-->
-<!--            <my-card-->
-<!--                v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
-<!--                icon="icon-tubiaozhizuomoban-135"-->
-<!--                title="本周保养任务"-->
-<!--                :tipNum="gatherTask.lubricationTaskMyDay"-->
-<!--                @handleLubrication="handleMaintainAll(0,2)"-->
-<!--            ></my-card>-->
-<!--            <my-card-->
-<!--                v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
-<!--                icon="icon-tubiaozhizuomoban-135"-->
-<!--                title="本月保养任务"-->
-<!--                :tipNum="gatherTask.lubricationTaskMyDay"-->
-<!--                @handleLubrication="handleMaintainAll(0,3)"-->
-<!--            ></my-card>-->
-            <my-card
-                icon="icon-weixiu"
-                title="维修任务"
-                :tipNum="gatherTask.repairTask"
-                @handleLubrication="handleService"
-            ></my-card>
+            <my-card icon="icon-tubiaozhizuomoban-135" title="本月保养任务" :tipNum="gatherTask.lubricationTaskMonth"
+                @handleLubrication="handleMaintain(3)"></my-card>
+            <!--            <my-card-->
+            <!--                v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
+            <!--                icon="icon-tubiaozhizuomoban-135"-->
+            <!--                title="今日保养任务"-->
+            <!--                :tipNum="gatherTask.lubricationTaskMyDay"-->
+            <!--                @handleLubrication="handleMaintainAll(0,1)"-->
+            <!--            ></my-card>-->
+            <!--            <my-card-->
+            <!--                v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
+            <!--                icon="icon-tubiaozhizuomoban-135"-->
+            <!--                title="本周保养任务"-->
+            <!--                :tipNum="gatherTask.lubricationTaskMyDay"-->
+            <!--                @handleLubrication="handleMaintainAll(0,2)"-->
+            <!--            ></my-card>-->
+            <!--            <my-card-->
+            <!--                v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
+            <!--                icon="icon-tubiaozhizuomoban-135"-->
+            <!--                title="本月保养任务"-->
+            <!--                :tipNum="gatherTask.lubricationTaskMyDay"-->
+            <!--                @handleLubrication="handleMaintainAll(0,3)"-->
+            <!--            ></my-card>-->
+            <my-card icon="icon-weixiu" title="维修任务" :tipNum="gatherTask.repairTask"
+                @handleLubrication="handleService"></my-card>
             <!--   <my-card
                      icon="icon-runhuaguanli"
                      title="点检任务"
@@ -300,7 +271,7 @@ export default {
             uni.setStorage({
                 key: DictCache.BASE_DATA_CACHE,
                 data: response.data,
-                success: function () {}
+                success: function () { }
             });
             this.statusMap = this.$DictCache.getLabelByValueMapByType(
                 this.$DictCache.TYPE.SB_INFO_STATUS
@@ -409,7 +380,7 @@ export default {
         // 当日现场保养任务
         handleMaintain(searchType) {
             uni.navigateTo({
-                url: '/pages/maintain/maintain-ignore?sbId=' + this.detailId + '&filter=2&searchType='+searchType
+                url: '/pages/maintain/maintain?sbId=' + this.detailId + '&filter=2&searchType=' + searchType
             });
         },
         // 我的保养任务:今日
@@ -518,10 +489,12 @@ export default {
 .d-flex.mb-2 {
     align-items: center;
 }
+
 .state-r {
     padding: 8rpx 20rpx;
     border-radius: 30rpx;
 }
+
 .state-g {
     padding: 8rpx 20rpx;
     border-radius: 30rpx;

+ 98 - 9
pages/maintain-detail/maintain-detail.vue

@@ -1,11 +1,20 @@
 <template>
   <view class="container py2">
+    <!-- 标准信息:与 PC 端 Detail 保持一致 -->
     <view class="mx3 p3 bg-color-white" style="border-radius: 16rpx">
-      <equipment-line title="状态" :content="statusMap[infoData.status]" />
-      <equipment-line title="要求" :content="infoData.requirement" />
-      <equipment-line title="执行标准" :content="infoData.remark" />
-      <equipment-line title="实际开始" :content="infoData.actualStartTime" />
-      <equipment-line title="完成时间" :content="infoData.actualEndTime" />
+      <view class="f-size-30 main-color-text pb-2">标准信息</view>
+      <equipment-line title="设备名称" :content="infoData.sbName" />
+      <equipment-line title="设备编码" :content="infoData.sbNo" />
+      <equipment-line title="标准编码" :content="modelStandard.no" />
+      <equipment-line title="检查类型" :content="getMapText(typeMap, modelStandard.type)" />
+      <equipment-line title="计划周期"
+        :content="(modelStandard.period || '') + getMapText(periodTypeMap, modelStandard.periodType)" />
+      <equipment-line title="维护等级" :content="getMapText(levelMap, modelStandard.level)" />
+      <equipment-line title="标准工时" :content="modelStandard.standardHours" />
+      <equipment-line title="动作类型" :content="getMapText(actionTypeMap, modelStandard.actionType)" />
+      <equipment-line title="部位" :content="modelStandard.partName" />
+      <equipment-line title="要求" :content="modelStandard.requirement" />
+      <equipment-line title="备注" :content="modelStandard.remark" />
     </view>
     <view class="m3 p3 bg-color-white" style="border-radius: 16rpx">
       <view class="pb-3 border-bottom">
@@ -58,12 +67,50 @@
             <u-image width="100" class="mr-2" :src="item" @click="handlePre(index)" mode="widthFix"><u-loading
                 slot="loading"></u-loading></u-image>
           </block>
+          <view v-if="checkImgList.length === 0">暂无</view>
         </view>
       </view>
     </view>
+    <!-- 标准文件:仅展示文件名 -->
+    <view class="m3 p3 bg-color-white" style="border-radius: 16rpx"
+      v-if="modelStandard.checkFileList && modelStandard.checkFileList.length > 0">
+      <view class="f-size-30 main-color-text pb-2">标准文件</view>
+      <view class="f-size-26 text-color-3 py2" v-for="item in modelStandard.checkFileList" :key="item.id">{{ item.name
+      }}</view>
+    </view>
+    <!-- 任务信息:与 PC 端 Detail 保持一致 -->
     <view class="m3 p3 bg-color-white" style="border-radius: 16rpx">
+      <view class="f-size-30 main-color-text pb-2">任务信息</view>
+      <equipment-line title="执行人" :content="infoData.checkUserName" />
+      <equipment-line title="实际工时" :content="infoData.realHours" />
+      <equipment-line title="预计执行日期" :content="infoData.startTime" />
+      <equipment-line title="预计下次执行" :content="infoData.nextDate" />
+      <equipment-line title="截至日期" :content="infoData.endTime" />
+      <equipment-line title="实际开始时间" :content="infoData.actualStartTime" />
+      <equipment-line title="实际结束时间" :content="infoData.actualEndTime" />
+      <equipment-line title="任务状态" :content="statusMap[infoData.status]" />
+      <equipment-line title="是否延期"
+        :content="(infoData.receiveOvertime === null || infoData.receiveOvertime === 0 || !infoData.receiveOvertime) ? '否' : '是'" />
       <equipment-line title="检查结果" :content="infoData.feedback" />
     </view>
+    <!-- 完成图片 -->
+    <view class="m3 p3 bg-color-white" style="border-radius: 16rpx">
+      <view class="d-flex py3 border-bottom">
+        <view class="f-size-26 text-color-9 w200">完成图片</view>
+        <view class="f-size-26 text-color-3 d-flex ">
+          <block v-for="(item, index) in imgList" :key="index">
+            <u-image width="100" class="mr-2" :src="item" @click="handleImgPre(index)" mode="widthFix"><u-loading
+                slot="loading"></u-loading></u-image>
+          </block>
+          <view v-if="imgList.length === 0">暂无</view>
+        </view>
+      </view>
+    </view>
+    <!-- 完成文件:仅展示文件名 -->
+    <view class="m3 p3 bg-color-white" style="border-radius: 16rpx" v-if="fileList.length > 0">
+      <view class="f-size-30 main-color-text pb-2">完成文件</view>
+      <view class="f-size-26 text-color-3 py2" v-for="item in fileList" :key="item.id">{{ item.name }}</view>
+    </view>
     <view class="p-fixed d-flex j-around a-center footer">
       <view v-if="infoData.status ===
         1 ||
@@ -94,7 +141,16 @@ export default {
       sbStatusMap: null,
       filter: 0,
       searchType: null,
+      // 标准信息(来自保养标准接口,与 PC 端 Detail 一致)
+      modelStandard: {},
+      typeMap: null,
+      periodTypeMap: null,
+      levelMap: null,
+      actionTypeMap: null,
       checkImgList: [],
+      // 完成图片/文件(任务接口返回)
+      imgList: [],
+      fileList: [],
       requirementList: [],
       displayTime: 0,
       timer: null,
@@ -108,12 +164,33 @@ export default {
     this.filter = options.filter
     this.statusMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.CHECK_JOB_STATUS)
     this.sbStatusMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.SB_INFO_STATUS)
+    this.typeMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.periodTypeMap = this.$DictCache.getLabelByValueMapByType(this.$DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
+    // 维护等级/动作类型本地字典无取值,走后台字典接口(与 PC 端 levelMap/actionTypeMap 对应)
+    this.$Http.getDictType({ type: 'CHECK_PLAN_LEVEL' }).then(res => {
+      const map = {}
+        ; (res.data || []).forEach(item => {
+          map[item.value] = item.label
+        })
+      this.levelMap = map
+    })
+    this.$Http.getDictType({ type: 'CHECK_PLAN_ACTION_TYPE' }).then(res => {
+      const map = {}
+        ; (res.data || []).forEach(item => {
+          map[item.value] = item.label
+        })
+      this.actionTypeMap = map
+    })
   },
   onShow() {
     this.initData()
   },
 
   methods: {
+    // 字典取值展示,防止 map 未加载时报错
+    getMapText(map, value) {
+      return map && map[value] != null ? map[value] : ''
+    },
     handlePre(index) {
       uni.previewImage({
         urls: this.checkImgList,
@@ -121,6 +198,13 @@ export default {
         success() { }
       })
     },
+    handleImgPre(index) {
+      uni.previewImage({
+        urls: this.imgList,
+        current: this.imgList[index],
+        success() { }
+      })
+    },
     handleExecute() {
       this.$Http.execute(this.infoData).then(res => {
         this.initData()
@@ -145,19 +229,24 @@ export default {
         })
         .then(res => {
           this.infoData = res.data
+          // 完成图片/文件:与 PC 端 Detail 一致,取任务接口返回的 imgList/fileList
+          this.imgList = (res.data.imgList || []).map(item => {
+            return this.$BaseTool.UserUtil.getFileUrl(item.url)
+          })
+          this.fileList = res.data.fileList || []
           this.$Http.fetchCheckStandard({ id: res.data.standardId }).then(response => {
+            this.modelStandard = response.data || {}
             if (res.data.conTask) {
               console.log(2)
               that.requirementList = JSON.parse(res.data.conTask)
             } else {
               that.requirementList = response.data.requirementList
             }
-          })
-          if (res.data.checkImgList.length > 0) {
-            this.checkImgList = res.data.checkImgList.map(item => {
+            // 标准图片:与 PC 端 Detail 一致,取自保养标准接口
+            this.checkImgList = ((response.data && response.data.checkImgList) || []).map(item => {
               return this.$BaseTool.UserUtil.getFileUrl(item.url)
             })
-          }
+          })
           this.$Http.timerStatus({ referenceId: this.infoData.id }).then(resp => {
             this.timerStatus = resp.data.timerStatus
             this.$Http.timerAccumulatedTime({ referenceId: this.infoData.id }).then(res => {

+ 15 - 14
pages/maintain/maintain-ignore.vue

@@ -3,7 +3,8 @@
     <common-tabs :list="list" :current="current" @change="change" />
     <view class="p-top8">
       <template v-if="listData.length > 0">
-        <view class="mx3 my2 p3 bg-color-white box p-relative" v-for="(item, index) in listData" :key="item.id" @click="handleDetail(item.id)" @longpress="showMask(item.id,$event)">
+        <view class="mx3 my2 p3 bg-color-white box p-relative" v-for="(item, index) in listData" :key="item.id"
+          @click="handleDetail(item.id)" @longpress="showMask(item.id, $event)">
           <common-mask :item="item" :maskId="maskId" @hide="maskId = 0" @del="handleDel(item.id)" />
           <view class="d-flex j-between border-bottom pb-2 a-center">
             <view class="text-color-b f-size-26 text-overflow">{{ item.sbNo }} ({{ item.sbName }})</view>
@@ -11,27 +12,26 @@
           </view>
           <view class="mt-2 d-flex j-between">
             <view class="text-color-3 f-size-32 f-weight-bold">{{
-                            item.requirement
-                        }}</view>
+              item.requirement
+            }}</view>
           </view>
           <view class="f-size-26 text-color-6 f-weight-4 mt-2">{{
-                        item.startTime
-                    }} ({{ item.period + periodMap[item.periodType] }}) : {{ item.partName==null?'无':item.partName}}</view>
+            item.startTime
+          }} ({{ item.period + periodMap[item.periodType] }}) : {{ item.partName == null ? '无' : item.partName }}
+          </view>
           <view class="d-flex j-end edit-box">
-            <view class="text-color-3 f-size-32 edit" v-if="(item.status === 1||
-                                item.status === 4) && !startFlag">
-              <view @click.stop="handleExecute(item)">开始</view>
+            <view class="text-color-3 f-size-32 edit" v-if="(item.status === 1) && !startFlag">
+              <view @click.stop="handleExecute(item)">接收</view>
             </view>
-            <view class="text-color-3 f-size-32 edit" v-if="(item.status === 1||
-                                item.status === 2||
-                                item.status === 4) && !startFlag">
-              <view @click.stop="handleFinish(item)">执行</view>
+            <!-- 与 PC 端 CheckJob 保持一致:仅执行中(2)可完成 -->
+            <view class="text-color-3 f-size-32 edit" v-if="item.status === 2 && !startFlag">
+              <view @click.stop="handleFinish(item)">完成</view>
             </view>
-            <view class="text-color-3 f-size-32 edit" v-if="item.status === 1||
+            <!-- <view class="text-color-3 f-size-32 edit" v-if="item.status === 1||
                                 item.status === 2 ||
                                 item.status === 4">
               <view @click.stop="submit(item)">完成</view>
-            </view>
+            </view> -->
           </view>
         </view>
         <view class="py3">
@@ -313,6 +313,7 @@ page {
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
 }
+
 .container {
   padding-bottom: 100rpx;
 

+ 27 - 16
pages/maintain/maintain.vue

@@ -12,25 +12,31 @@
           </view>
           <view class="mt-2 d-flex j-between">
             <view class="text-color-3 f-size-32 f-weight-bold">{{
-              item.requirementList ? item.requirementList.map(i => i.stdName).filter(name => name).join('、') : ''
+              item.requirementList ? item.requirementList.map(i => i.stdName).join('、') : ''
             }}</view>
           </view>
-          <view class="f-size-26 text-color-6 f-weight-4 mt-2">{{
+          <view class="f-size-26 text-color-6 f-weight-4 mt-2">计划执行日期:{{
             item.startTime
-          }} ({{ item.period + periodMap[item.periodType] }}) : {{ item.partName == null ? '无' : item.partName }}</view>
+          }}
+          </view>
+          <view class="f-size-26 text-color-6 f-weight-4 mt-2">实际执行日期:{{
+            item.actualStartTime
+          }}
+          </view>
+          <view class="f-size-26 text-color-6 f-weight-4 mt-2">设备部位:{{
+            item.partName
+          }}
+          </view>
           <view class="d-flex j-end edit-box">
-            <view class="text-color-3 f-size-32 edit" v-if="(item.status === 1 ||
-              item.status === 4) && !startFlag">
+            <!-- 与 PC 端 CheckJob 保持一致:仅未执行(1)可接收 -->
+            <view class="text-color-3 f-size-32 edit" v-if="item.status === 1 && !startFlag">
               <view @click.stop="handleExecute(item)">开始</view>
             </view>
-            <view class="text-color-3 f-size-32 edit" v-if="(item.status === 2 ||
-              item.status === 2 ||
-              item.status === 4) && !startFlag">
+            <!-- 与 PC 端 CheckJob 保持一致:仅执行中(2)可执行/完成 -->
+            <!-- <view class="text-color-3 f-size-32 edit" v-if="item.status === 2 && !startFlag">
               <view @click.stop="handleFinish(item)">执行</view>
-            </view>
-            <view class="text-color-3 f-size-32 edit" v-if="item.status === 2 ||
-              item.status === 2 ||
-              item.status === 4">
+            </view> -->
+            <view class="text-color-3 f-size-32 edit" v-if="item.status === 2">
               <view @click.stop="submit(item)">完成</view>
             </view>
           </view>
@@ -217,9 +223,10 @@ export default {
       if (index === 0) {
         this.type = ''
       } else if (value === 4) {
+        // 已过期与 PC 端逾期页(PollingCheckJobOverTime)一致:receiveOvertime + 不限状态
         this.type = null
-        this.statusList = [1, 2]
-        this.receiveOvertime = 1
+        this.statusList = []
+        this.receiveOvertime = true
       } else {
         this.type = value
       }
@@ -284,8 +291,12 @@ export default {
           sbId: this.sbId,
           status: this.type,
           receiveOvertime: this.receiveOvertime,
-          statusList: this.statusList,
-          timeFlag: this.timeFlag
+          // 与 PC 端 CheckJob 一致:默认只查未执行/执行中/已完成,不含已过期(4)
+          statusList: this.statusList === null ? [1, 2, 3] : this.statusList,
+          timeFlag: this.timeFlag,
+          // 与 PC 端 CheckJob loadData 参数保持一致
+          mineFlag: false,
+          record: this.type === 3 ? 1 : null
         })
         .then(res => {
           const data = res.data.rows

+ 31 - 25
pages/my/my.vue

@@ -36,7 +36,8 @@
             ></my-card>-->
             <!-- <my-card icon="icon-tubiaozhizuomoban-135" title="今日保养任务" :tipNum="gatherTask.lubricationTask" @handleLubrication="handleMaintain(1)"></my-card> -->
             <!-- <my-card icon="icon-tubiaozhizuomoban-135" title="本周保养任务" :tipNum="gatherTask.lubricationTaskWeek" @handleLubrication="handleMaintain(2)"></my-card> -->
-            <my-card icon="icon-tubiaozhizuomoban-135" title="本月保养任务" :tipNum="gatherTask.lubricationTaskMonth" @handleLubrication="handleMaintain(3)"></my-card>
+            <my-card icon="icon-tubiaozhizuomoban-135" title="本月保养任务" :tipNum="gatherTask.lubricationTaskMonth"
+                @handleLubrication="handleMaintain(3)"></my-card>
             <!--            <my-card
                 icon="icon-jiayou"
                 title="加油任务"
@@ -44,8 +45,13 @@
                 @handleLubrication="handleOiling"
                 iColor="#F1650C"
             ></my-card>-->
-            <my-card v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())" icon="icon-weixiu" title="维修任务" :tipNum="gatherTask.repairTask" @handleLubrication="handleService"></my-card>
-            <my-card v-show="$BaseTool.UserUtil.getUserInfo() != null && $BaseTool.UserUtil.isManagerRole()" icon="icon-tubiaozhizuomoban-135" title="审核任务" :tipNum="gatherTask.repairCheckTask" @handleLubrication="handleRepairCheck"></my-card>
+            <my-card
+                v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"
+                icon="icon-weixiu" title="维修任务" :tipNum="gatherTask.repairTask"
+                @handleLubrication="handleService"></my-card>
+            <my-card v-show="$BaseTool.UserUtil.getUserInfo() != null && $BaseTool.UserUtil.isManagerRole()"
+                icon="icon-tubiaozhizuomoban-135" title="审核任务" :tipNum="gatherTask.repairCheckTask"
+                @handleLubrication="handleRepairCheck"></my-card>
             <!--            <my-card
                 icon="icon-tubiaozhizuomoban-135"
                 title="盘点任务"
@@ -116,7 +122,7 @@ export default {
             ]
         }
     },
-    onLoad() {},
+    onLoad() { },
 
     onShow() {
         this.userInfo = this.$BaseTool.UserUtil.getUserInfo()
@@ -191,7 +197,7 @@ export default {
         // 保养任务
         handleMaintain(searchType) {
             uni.navigateTo({
-                url: '../maintain/mainPosition?timeFlag=' + searchType
+                url: '/pages/maintain/maintain?filter=2&searchType=' + searchType
             })
         },
         // 巡检任务
@@ -260,35 +266,35 @@ export default {
 
 <style lang="less">
 page {
-  background-color: #f4f4f4;
+    background-color: #f4f4f4;
 }
 
 .often {
-  image {
-    width: unit(50, rpx);
-    height: unit(50, rpx);
-  }
+    image {
+        width: unit(50, rpx);
+        height: unit(50, rpx);
+    }
 
-  .iconfont {
-    font-size: unit(50, rpx);
-  }
+    .iconfont {
+        font-size: unit(50, rpx);
+    }
 }
 
 .top {
-  height: unit(200, rpx);
+    height: unit(200, rpx);
 
-  .img {
-    width: unit(128, rpx);
-    height: unit(128, rpx);
-    border-radius: 50%;
+    .img {
+        width: unit(128, rpx);
+        height: unit(128, rpx);
+        border-radius: 50%;
 
-    image {
-      width: unit(128, rpx);
-      height: unit(128, rpx);
-      border-radius: 50%;
-      background-color: #999;
-      // border: 5rpx solid #fff;
+        image {
+            width: unit(128, rpx);
+            height: unit(128, rpx);
+            border-radius: 50%;
+            background-color: #999;
+            // border: 5rpx solid #fff;
+        }
     }
-  }
 }
 </style>