Pārlūkot izejas kodu

调整记录校核列表交互逻辑

yangguanjin 12 stundas atpakaļ
vecāks
revīzija
9eb7c1a252

+ 160 - 67
src/pages/pendingVerification/list/BoilerItem.vue

@@ -1,74 +1,84 @@
 <template>
-  <view class="item-box">
-    <view class="item-top">
-      <view class="item-top-left">
-        <view class="row">
-          <text class="item-top-text">
-            任务单号:{{ item.orderNo }}
-            <text>
-              (
-              <text :style="{ color: checkTypeColor }">{{ checkType }}</text>
-              )
+  <wd-collapse v-model="collapseValue" accordion class="item-collapse">
+    <wd-collapse-item :name="item.orderNo">
+      <template #title="{ expanded }">
+        <view class="item-box">
+          <view class="item-top">
+            <view class="item-top-left">
+              <view class="row">
+                <text class="item-top-text">
+                  任务单号:{{ item.orderNo }}
+                  <text>
+                    (
+                    <text :style="{ color: checkTypeColor }">{{ checkType }}</text>
+                    )
+                  </text>
+                </text>
+                <text v-if="item.equipNum" class="item-top-num-box">{{ item.equipNum }}台</text>
+              </view>
+            </view>
+          </view>
+
+          <view class="item-center">
+            <view class="row-center">
+              <text class="title">
+                检测时间:
+                <text class="text">{{ checkDate }}</text>
+              </text>
+              <text class="title">
+                设备注册代码:
+                <text class="text">{{ item.equipCode }}</text>
+              </text>
+            </view>
+
+            <text class="title">
+              使用单位:
+              <text class="text">{{ item.unitName }}</text>
             </text>
-          </text>
-          <text v-if="item.equipNum" class="item-top-num-box">{{ item.equipNum }}台</text>
-        </view>
-      </view>
-    </view>
-
-    <view class="item-center">
-      <view class="row-center">
-        <text class="title">
-          检测时间:
-          <text class="text">{{ checkDate }}</text>
-        </text>
-        <text class="title">
-          设备注册代码:
-          <text class="text">{{ item.equipCode }}</text>
-        </text>
-        <view class="row">
-          <text class="title">主报告状态:</text>
-          <view class="status-badge">
-            <text class="status-text">{{ taskStatusText }}</text>
+            <view class="row-center">
+              <text class="title">
+                项目负责人:
+                <text class="text">{{ item?.manager?.nickname }}</text>
+              </text>
+              <text class="title">
+                主检人:
+                <text class="text">{{ item?.mainCheckerUser?.nickname }}</text>
+              </text>
+            </view>
+            <text class="title">
+              检验员:
+              <text class="text">{{ checkUsersText }}</text>
+            </text>
+          </view>
+
+          <view class="btn-group">
+            <button v-show="item.recheckStatus == '100'" class="main-btn" @click.stop="handleOperation">
+              <text class="main-btn-text">{{ operateText }}</text>
+            </button>
+          </view>
+
+          <view class="collapse-arrow">
+            <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': expanded }" />
           </view>
         </view>
-      </view>
+      </template>
 
-      <text class="title">
-        使用单位:
-        <text class="text">{{ item.unitName }}</text>
-      </text>
-      <view class="row-center">
-        <text class="title">
-          项目负责人:
-          <text class="text">{{ item?.manager?.nickname }}</text>
-        </text>
-        <text class="title">
-          主检人:
-          <text class="text">{{ item?.mainCheckerUser?.nickname }}</text>
-        </text>
+      <view class="recheck-list">
+        <view v-if="item.recheckReportList?.length" v-for="report in item.recheckReportList" :key="report.reportId" class="recheck-item">
+          <text class="recheck-report-name">{{ report.reportName }}</text>
+          <view v-if="statusFilter === '100'" class="recheck-btn" @click.stop="handleOperation(item, report)">
+            <text class="recheck-btn-text">校核</text>
+          </view>
+        </view>
+        <view v-else class="recheck-empty">暂无校核项</view>
       </view>
-      <text class="title">
-        检验员:
-        <text class="text">{{ checkUsersText }}</text>
-      </text>
-      <text class="title">
-        检验项目:
-        <text class="text">{{ reportText }}</text>
-      </text>
-    </view>
-
-    <view class="btn-group">
-      <button v-show="item.recheckStatus == '100'" class="main-btn" @click="handleOperation">
-          <text class="main-btn-text">{{ operateText }}</text>
-      </button>
-    </view>
-
-  </view>
+    </wd-collapse-item>
+  </wd-collapse>
 </template>
 
 <script lang="ts" setup>
-import { computed } from 'vue'
+import { computed, ref } from 'vue'
+import iconMap from '@/utils/imagesMap'
 import { BoilerPressureCheckTypeMap } from '@/utils/dictMap'
 import { PressureCheckerMyTaskStatusMap } from '@/utils/dictMap'
 
@@ -76,14 +86,18 @@ interface Props {
   item: any
   reportDOList: any[]
   operateText: string
+  statusFilter: string
 }
 
 const props = defineProps<Props>()
 
 const emit = defineEmits<{
   handleOperation: [item: any, reportDOList: any]
+  handleRecheck: [item: any, report: any]
 }>()
 
+const collapseValue = ref<string>('')
+
 const checkType = computed(() => {
   return BoilerPressureCheckTypeMap[props.item.checkType] || ''
 })
@@ -116,17 +130,17 @@ const taskStatusText = computed(() => {
   return PressureCheckerMyTaskStatusMap[props.item.taskStatus] || ''
 })
 
-const handleOperation = () => {
-  emit('handleOperation', props.item, props.reportDOList)
+const handleOperation = (taskOrder, recheckItem) => {
+  emit('handleOperation', taskOrder, recheckItem)
 }
+
 </script>
 
 <style lang="scss" scoped>
 .item-box {
-  margin: 13px;
-  padding: 13px;
   background-color: #fff;
   border-radius: 5px;
+  position: relative;
 }
 
 .row {
@@ -239,4 +253,83 @@ const handleOperation = () => {
   justify-content: flex-end;
   margin-top: 10px;
 }
-</style>
+
+.collapse-arrow {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding-top: 8px;
+}
+
+.arrow-icon {
+  width: 24px;
+  height: 14px;
+  transition: transform 0.3s;
+}
+
+.arrow-rotate {
+  transform: rotate(180deg);
+}
+
+/* collapse 外层覆盖 */
+.item-collapse {
+  :deep(.wd-collapse-item__title) {
+    padding: 0;
+  }
+
+  :deep(.wd-collapse-item__title-wrapper) {
+    background-color: transparent;
+  }
+
+  :deep(.wd-collapse-item__arrow) {
+    display: none;
+  }
+
+  :deep(.wd-collapse-item__content) {
+    padding: 0 13px 13px;
+  }
+}
+
+/* recheck 列表 */
+.recheck-list {
+  background-color: #fff;
+  border-radius: 5px;
+}
+
+.recheck-item {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  padding: 10px 13px;
+  border-bottom: 1px solid rgb(244, 244, 244);
+
+  &:last-child {
+    border-bottom: none;
+  }
+}
+
+.recheck-report-name {
+  font-size: 14px;
+  color: #333;
+}
+
+.recheck-btn {
+  padding: 4px 12px;
+  border-radius: 3px;
+  background-color: #fff;
+  border: 1px solid rgb(47, 142, 255);
+}
+
+.recheck-btn-text {
+  font-size: 13px;
+  color: rgb(47, 142, 255);
+}
+
+.recheck-empty {
+  padding: 20px 0;
+  text-align: center;
+  font-size: 13px;
+  color: #999;
+}
+</style>

+ 5 - 4
src/pages/pendingVerification/list/PendingVerificationList.vue

@@ -42,6 +42,7 @@
           :item="item"
           :reportDOList="reportDOList(item)"
           :operate-text="'校核'"
+          :status-filter="statusFilter"
           @handle-operation="pushAction"
         />
       </view>
@@ -78,7 +79,7 @@ const loading = ref(false)
 const hasMore = ref(true)
 const statusFilter = ref('100')
 const statusFilterList = [
-  { value: '全部', id: '' },
+  // { value: '全部', id: '' },
   { value: '校核中', id: '100' },
   { value: '已通过', id: '200' },
   { value: '已退回', id: '300' },
@@ -187,13 +188,13 @@ const reportDOList = (item: any) => {
 }
 
 // 跳转操作
-const pushAction = (item: any, reportDOList: any) => {
-  if (!item.reportId) {
+const pushAction = (taskItem, recheckItem) => {
+  if (!recheckItem.reportId) {
     return uni.showToast({ title: '没有报告', icon: 'error' })
   }
 
   uni.navigateTo({
-    url: `/pages/pendingVerification/preViewReport/index?id=${item.id}&orderId=${item.orderId}&reportId=${item.reportId}&reportDOList=${encodeURIComponent(JSON.stringify(reportDOList))}&equipCode=${item.equipCode}&isBatch=0`,
+    url: `/pages/pendingVerification/preViewReport/index?id=${taskItem.id}&orderId=${taskItem.orderId}&reportId=${recheckItem.reportId}&equipCode=${taskItem.equipCode}&isBatch=0`,
   })
 }
 

+ 153 - 67
src/pages/pendingVerification/list/PipeItem.vue

@@ -1,74 +1,78 @@
 <template>
-  <view class="item-box">
-    <view class="item-top">
-      <view class="item-top-left">
-        <view class="row">
-          <text class="item-top-text">
-            任务单号:{{ item.orderNo }}
-            <text>
-              (
-              <text :style="{ color: checkTypeColor }">{{ checkType }}</text>
-              )
+  <wd-collapse v-model="collapseValue" accordion class="item-collapse">
+    <wd-collapse-item :name="item.orderNo">
+      <template #title="{ expanded }">
+        <view class="item-box">
+          <view class="item-top">
+            <view class="item-top-left">
+              <view class="row">
+                <text class="item-top-text">
+                  任务单号:{{ item.orderNo }}
+                  <text>
+                    (
+                    <text :style="{ color: checkTypeColor }">{{ checkType }}</text>
+                    )
+                  </text>
+                </text>
+                <text v-if="item.equipNum" class="item-top-num-box">{{ item.equipNum }}台</text>
+              </view>
+            </view>
+          </view>
+
+          <view class="item-center">
+            <view class="row-center">
+              <text class="title">
+                检测时间:
+                <text class="text">{{ checkDate }}</text>
+              </text>
+              <text class="title">
+                工程号:
+                <text class="text">{{ item.projectNo || '-' }}</text>
+              </text>
+            </view>
+
+            <text class="title">
+              使用单位:
+              <text class="text">{{ item.unitName }}</text>
             </text>
-          </text>
-          <text v-if="item.equipNum" class="item-top-num-box">{{ item.equipNum }}台</text>
-        </view>
-      </view>
-    </view>
-
-    <view class="item-center">
-      <view class="row-center">
-        <text class="title">
-          检测时间:
-          <text class="text">{{ checkDate }}</text>
-        </text>
-        <text class="title">
-          工程号:
-          <text class="text">{{ item.projectNo || '-' }}</text>
-        </text>
-        <view class="row">
-          <text class="title">主报告状态:</text>
-          <view class="status-badge">
-            <text class="status-text">{{ taskStatusText }}</text>
+            <view class="row-center">
+              <text class="title">
+                项目负责人:
+                <text class="text">{{ item?.manager?.nickname }}</text>
+              </text>
+              <text class="title">
+                主检人:
+                <text class="text">{{ item?.mainCheckerUser?.nickname }}</text>
+              </text>
+            </view>
+            <text class="title">
+              检验员:
+              <text class="text">{{ checkUsersText }}</text>
+            </text>
+          </view>
+
+          <view class="collapse-arrow">
+            <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': expanded }" />
           </view>
         </view>
-      </view>
+      </template>
 
-      <text class="title">
-        使用单位:
-        <text class="text">{{ item.unitName }}</text>
-      </text>
-      <view class="row-center">
-        <text class="title">
-          项目负责人:
-          <text class="text">{{ item?.manager?.nickname }}</text>
-        </text>
-        <text class="title">
-          主检人:
-          <text class="text">{{ item?.mainCheckerUser?.nickname }}</text>
-        </text>
+      <view class="recheck-list">
+        <view v-if="item.recheckReportList?.length" v-for="report in item.recheckReportList" :key="report.reportId" class="recheck-item">
+          <text class="recheck-report-name">{{ report.reportName }}</text>
+          <view v-if="statusFilter === '100'" class="recheck-btn"  @click.stop="handleOperation(item, report)">
+            <text class="recheck-btn-text">校核</text>
+          </view>
+        </view>
+        <view v-else class="recheck-empty">暂无校核项</view>
       </view>
-      <text class="title">
-        检验员:
-        <text class="text">{{ checkUsersText }}</text>
-      </text>
-      <text class="title">
-        检验项目:
-        <text class="text">{{ reportText }}</text>
-      </text>
-    </view>
-
-    <view class="btn-group">
-      <button v-show="item.recheckStatus == '100'" class="main-btn" @click="handleOperation">
-          <text class="main-btn-text">{{ operateText }}</text>
-      </button>
-    </view>
-
-  </view>
+    </wd-collapse-item>
+  </wd-collapse>
 </template>
 
 <script lang="ts" setup>
-import { computed } from 'vue'
+import { computed, ref } from 'vue'
+import iconMap from '@/utils/imagesMap'
 import { PipeCheckTypeMap } from '@/utils/dictMap'
 import { PressureCheckerMyTaskStatusMap } from '@/utils/dictMap'
 
@@ -76,14 +80,18 @@ interface Props {
   item: any
   reportDOList: any[]
   operateText: string
+  statusFilter: string
 }
 
 const props = defineProps<Props>()
 
 const emit = defineEmits<{
   handleOperation: [item: any, reportDOList: any]
+  handleRecheck: [item: any, report: any]
 }>()
 
+const collapseValue = ref<string>('')
+
 const checkType = computed(() => {
   return PipeCheckTypeMap[props.item.checkType] || ''
 })
@@ -116,17 +124,16 @@ const taskStatusText = computed(() => {
   return PressureCheckerMyTaskStatusMap[props.item.taskStatus] || ''
 })
 
-const handleOperation = () => {
-  emit('handleOperation', props.item, props.reportDOList)
+const handleOperation = (taskOrder, recheckItem) => {
+  emit('handleOperation', taskOrder, recheckItem)
 }
 </script>
 
 <style lang="scss" scoped>
 .item-box {
-  margin: 13px;
-  padding: 13px;
   background-color: #fff;
   border-radius: 5px;
+  position: relative;
 }
 
 .row {
@@ -239,4 +246,83 @@ const handleOperation = () => {
   justify-content: flex-end;
   margin-top: 10px;
 }
-</style>
+
+.collapse-arrow {
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  padding-top: 8px;
+}
+
+.arrow-icon {
+  width: 24px;
+  height: 14px;
+  transition: transform 0.3s;
+}
+
+.arrow-rotate {
+  transform: rotate(180deg);
+}
+
+/* collapse 外层覆盖 */
+.item-collapse {
+  :deep(.wd-collapse-item__title) {
+    padding: 0;
+  }
+
+  :deep(.wd-collapse-item__title-wrapper) {
+    background-color: transparent;
+  }
+
+  :deep(.wd-collapse-item__arrow) {
+    display: none;
+  }
+
+  :deep(.wd-collapse-item__content) {
+    padding: 0 13px 13px;
+  }
+}
+
+/* recheck 列表 */
+.recheck-list {
+  background-color: #fff;
+  border-radius: 5px;
+}
+
+.recheck-item {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: space-between;
+  padding: 10px 13px;
+  border-bottom: 1px solid rgb(244, 244, 244);
+
+  &:last-child {
+    border-bottom: none;
+  }
+}
+
+.recheck-report-name {
+  font-size: 14px;
+  color: #333;
+}
+
+.recheck-btn {
+  padding: 4px 12px;
+  border-radius: 3px;
+  background-color: #fff;
+  border: 1px solid rgb(47, 142, 255);
+}
+
+.recheck-btn-text {
+  font-size: 13px;
+  color: rgb(47, 142, 255);
+}
+
+.recheck-empty {
+  padding: 20px 0;
+  text-align: center;
+  font-size: 13px;
+  color: #999;
+}
+</style>

+ 0 - 1
src/pages/pendingVerification/preViewReport/index.vue

@@ -169,7 +169,6 @@ const confirmReject = async () => {
 
   uni.showLoading({ title: '退回中...' })
 
-  debugger
   try {
     const result: any = await ApprovalRequestFunc(
       ApprovalFuncName.Reject,