소스 검색

调整QueryView组件字段显隐逻辑

yangguanjin 2 일 전
부모
커밋
a17ad903a9

+ 8 - 7
src/components/QueryViewItem/CheckNatureCom.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="check-nature-box">
-    <text class="title" :style="textStyle">检验性质:</text>
+    <text class="title" :style="textStyle">{{ title }}</text>
     <wd-picker
       class="nature-picker"
       v-model="selectCode"
@@ -24,17 +24,18 @@ import {
   PipeCheckTypeMap,
   PressureCheckTypeMap,
 } from '@/utils/dictMap'
-import { useConfigStore } from '@/store/config'
-
-const configStore = useConfigStore()
-const equipType = configStore.getEquipType()
 
 interface Props {
+  title: string
   type: string
+  equipType?: EquipmentType
   textStyle?: any
 }
 
-const props = defineProps<Props>()
+const props = withDefaults(defineProps<Props>(), {
+  title: '检验性质:',
+  equipType: EquipmentType.CONTAINER,
+})
 
 const emit = defineEmits<{
   change: [text: number | undefined, type: string]
@@ -44,7 +45,7 @@ const selectCode = ref<number | undefined>(undefined)
 
 const columns = computed(() => {
   let checkTypeMap = PressureCheckTypeMap
-  switch(equipType) {
+  switch(props.equipType) {
     case EquipmentType.BOILER:
       checkTypeMap = BoilerPressureCheckTypeMap
       break

+ 6 - 4
src/pages/pendingApproval/components/query/QueryView.vue

@@ -12,12 +12,14 @@
         />
         <CheckNatureCom
           ref="checkTypeRef"
+          title="检验性质:"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkType', $event)"
         />
         <CheckDateCom
           ref="checkDateRef"
+          title="检验时间:"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkDate', $event)"
@@ -25,11 +27,11 @@
         <CellCom
           ref="approveStrIdsRef"
           :title="queryType.value + ':'"
-          :type="queryType.id"
+          type="approveStrIds"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           :default-value="defaultValue"
-          @click="showUserListPopup(queryType.value, queryType.id)"
+          @click="showUserListPopup(queryType.value, 'approveStrIds')"
         />
       </view>
 
@@ -95,7 +97,7 @@ const isOpen = ref(false)
 const params = reactive<Record<string, any>>({
   orderNo: '',
   checkType: '',
-  [props.queryType.id]: userInfo.value?.id || '',
+  approveStrIds: userInfo.value?.id || '',
   checkDate: '',
   equipCode: '',
   unitName: '',
@@ -136,7 +138,7 @@ const reset = () => {
   Object.assign(params, {
     orderNo: '',
     checkType: '',
-    [props.queryType.id]: userInfo.value?.id || '',
+    approveStrIds: userInfo.value?.id || '',
     checkDate: '',
     equipCode: '',
     unitName: '',

+ 6 - 4
src/pages/pendingPreparation/components/query/QueryView.vue

@@ -12,12 +12,14 @@
         />
         <CheckNatureCom
           ref="checkTypeRef"
+          title="检验性质:"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkType', $event)"
         />
         <CheckDateCom
           ref="checkDateRef"
+          title="检验时间:"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkDate', $event)"
@@ -25,11 +27,11 @@
         <CellCom
           ref="mainCheckerStrIdsRef"
           :title="queryType.value + ':'"
-          :type="queryType.id"
+          type="mainCheckerStrIds"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           :default-value="defaultValue"
-          @click="showUserListPopup(queryType.value, queryType.id)"
+          @click="showUserListPopup(queryType.value, 'mainCheckerStrIds')"
         />
       </view>
 
@@ -95,7 +97,7 @@ const isOpen = ref(false)
 const params = reactive<Record<string, any>>({
   orderNo: '',
   checkType: '',
-  [props.queryType.id]: userInfo.value?.id || '',
+  mainCheckerStrIds: userInfo.value?.id || '',
   checkDate: '',
   equipCode: '',
   unitName: '',
@@ -136,7 +138,7 @@ const reset = () => {
   Object.assign(params, {
     orderNo: '',
     checkType: '',
-    [props.queryType.id]: userInfo.value?.id || '',
+    mainCheckerStrIds: userInfo.value?.id || '',
     checkDate: '',
     equipCode: '',
     unitName: '',

+ 6 - 4
src/pages/pendingRatify/components/query/QueryView.vue

@@ -12,12 +12,14 @@
         />
         <CheckNatureCom
           ref="checkTypeRef"
+          title="检验性质:"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkType', $event)"
         />
         <CheckDateCom
           ref="checkDateRef"
+          title="检验时间:"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkDate', $event)"
@@ -25,11 +27,11 @@
         <CellCom
           ref="ratifyStrIdsRef"
           :title="queryType.value + ':'"
-          :type="queryType.id"
+          type="ratifyStrIds"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           :default-value="defaultValue"
-          @click="showUserListPopup(queryType.value, queryType.id)"
+          @click="showUserListPopup(queryType.value, 'ratifyStrIds')"
         />
       </view>
 
@@ -95,7 +97,7 @@ const isOpen = ref(false)
 const params = reactive<Record<string, any>>({
   orderNo: '',
   checkType: '',
-  [props.queryType.id]: userInfo.value?.id || '',
+  ratifyStrIds: userInfo.value?.id || '',
   checkDate: '',
   equipCode: '',
   unitName: '',
@@ -136,7 +138,7 @@ const reset = () => {
   Object.assign(params, {
     orderNo: '',
     checkType: '',
-    [props.queryType.id]: userInfo.value?.id || '',
+    ratifyStrIds: userInfo.value?.id || '',
     checkDate: '',
     equipCode: '',
     unitName: '',

+ 0 - 276
src/pages/pendingVerification/components/BoilerQueryView.vue

@@ -1,276 +0,0 @@
-<template>
-  <view class="query-view">
-    <view class="query-content" :style="contentStyle">
-      <view class="query-left">
-        <InputCom
-          ref="orderNoRef"
-          title="任务单号:"
-          type="orderNo"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('orderNo', $event)"
-        />
-        <CheckNatureCom
-          ref="checkTypeRef"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('checkType', $event)"
-        />
-        <CheckDateCom
-          ref="checkDateRef"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('checkDate', $event)"
-        />
-        <!-- <CellCom
-          ref="mainCheckerStrIdsRef"
-          title="主检人:"
-          type="mainCheckerStrIds"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @click="showUserListPopup('主检人', 'mainCheckerStrIds')"
-        />
-        <CellCom
-          ref="managerIdRef"
-          title="项目负责人:"
-          type="managerId"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @click="showUserListPopup('项目负责人', 'managerId')"
-        /> -->
-      </view>
-
-      <view class="query-right">
-        <CellCom
-          ref="queryTypeRef"
-          :title="queryType.value + ':'"
-          :type="queryType.id"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          :default-value="defaultValue"
-          @click="showUserListPopup(queryType.value, queryType.id)"
-        />
-        <InputCom
-          ref="equipCodeRef"
-          title="设备注册代码:"
-          type="equipCode"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('equipCode', $event)"
-        />
-        <InputCom
-          ref="unitNameRef"
-          title="单位名称:"
-          type="unitName"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('unitName', $event)"
-        />
-        <!-- <CellCom
-          ref="checkUserStrIdsRef"
-          title="检验员:"
-          type="checkUserStrIds"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @click="showUserListPopup('检验员', 'checkUserStrIds')"
-        /> -->
-
-        <view class="btn-group">
-          <button class="btn reset-btn" @click="reset">重置</button>
-          <button class="btn query-btn" @click="query">查询</button>
-        </view>
-      </view>
-    </view>
-
-    <view class="query-toggle" @click="toggleFilter">
-      <text class="query-toggle-text">查询</text>
-      <image
-        class="arrow-icon"
-        :src="iconMap.ArrowDown"
-        :class="{ 'arrow-rotate': isOpen }"
-      />
-    </view>
-  </view>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, computed } from 'vue'
-import { useUserStore } from '@/store/user'
-import iconMap from '@/utils/imagesMap'
-import { InputCom } from '@/components/QueryViewItem'
-import { CheckDateCom } from '@/components/QueryViewItem'
-import { CheckNatureCom } from '@/components/QueryViewItem'
-import { CellCom } from '@/components/QueryViewItem'
-
-interface Props {
-  queryType: { value: string; id: string }
-}
-
-const props = defineProps<Props>()
-
-const emit = defineEmits<{
-  queryAction: [params: Record<string, any>]
-}>()
-
-const userStore = useUserStore()
-const userInfo = computed(() => userStore.userInfo)
-
-const isOpen = ref(false)
-const params = reactive<Record<string, any>>({
-  orderNo: '',
-  checkType: '',
-  mainCheckerStrIds: '',
-  [props.queryType.id]: userInfo.value?.id || '',
-  checkDate: '',
-  checkUserStrIds: '',
-  equipCode: '',
-  unitName: '',
-  managerId: '',
-})
-
-const defaultValue = computed(() => userInfo.value?.nickname || '')
-
-const contentStyle = computed(() => ({
-  height: isOpen.value ? '220px' : '0',
-  opacity: isOpen.value ? 1 : 0,
-  overflow: 'hidden',
-  transition: 'all 0.3s',
-}))
-
-const orderNoRef = ref<any>(null)
-const checkTypeRef = ref<any>(null)
-const checkDateRef = ref<any>(null)
-const mainCheckerStrIdsRef = ref<any>(null)
-const managerIdRef = ref<any>(null)
-const queryTypeRef = ref<any>(null)
-const equipCodeRef = ref<any>(null)
-const unitNameRef = ref<any>(null)
-const checkUserStrIdsRef = ref<any>(null)
-
-const toggleFilter = () => {
-  isOpen.value = !isOpen.value
-}
-
-const handleChange = (propName: string, value: any) => {
-  params[propName] = value
-}
-
-const reset = () => {
-  orderNoRef.value?.reset()
-  checkTypeRef.value?.reset()
-  checkDateRef.value?.reset()
-  mainCheckerStrIdsRef.value?.reset()
-  managerIdRef.value?.reset()
-  equipCodeRef.value?.reset()
-  unitNameRef.value?.reset()
-  checkUserStrIdsRef.value?.reset()
-
-  Object.assign(params, {
-    orderNo: '',
-    checkType: '',
-    mainCheckerStrIds: '',
-    [props.queryType.id]: userInfo.value?.id || '',
-    checkDate: '',
-    checkUserStrIds: '',
-    equipCode: '',
-    unitName: '',
-    managerId: '',
-  })
-
-  emit('queryAction', params)
-}
-
-const query = () => {
-  Object.assign(params, {
-    checkType: checkTypeRef.value?.inputContent,
-    checkDate: checkDateRef.value?.inputContent,
-  })
-  emit('queryAction', params)
-}
-
-const showUserListPopup = (title: string, type: string) => {
-  console.log('显示用户列表弹窗:', title, type)
-}
-</script>
-
-<style lang="scss" scoped>
-.query-view {
-  width: 100%;
-  background-color: #fff;
-}
-
-.query-content {
-  display: flex;
-  flex-direction: row;
-  flex-wrap: nowrap;
-  justify-content: space-between;
-  padding: 0 15px;
-}
-
-.query-left,
-.query-right {
-  flex: 1;
-  padding: 15px 0;
-}
-
-.query-right {
-  margin-left: 10px;
-}
-
-.btn-group {
-  display: flex;
-  flex-direction: row;
-  justify-content: flex-end;
-  margin-top: 10px;
-  padding: 0 10%;
-  gap: 10%;
-}
-
-.btn {
-  padding: 0 15px;
-  height: 30px;
-  margin-left: 5px;
-  border-radius: 3px;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  font-size: 15px;
-  border: none;
-}
-
-.reset-btn {
-  background-color: #fff;
-  color: rgb(47, 142, 255);
-  border: 1px solid rgb(47, 142, 255);
-}
-
-.query-btn {
-  background-color: rgb(47, 142, 255);
-  color: rgb(222, 238, 255);
-}
-
-.query-toggle {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  align-items: center;
-  padding: 0 20px;
-  height: 60px;
-  border-top: 1px solid rgba(187, 187, 187, 0.8);
-}
-
-.query-toggle-text {
-  color: rgb(51, 51, 51);
-  font-size: 16px;
-}
-
-.arrow-icon {
-  width: 21px;
-  height: 21px;
-  transition: transform 0.3s;
-}
-
-.arrow-rotate {
-  transform: rotate(180deg);
-}
-</style>

+ 0 - 276
src/pages/pendingVerification/components/PipeQueryView.vue

@@ -1,276 +0,0 @@
-<template>
-  <view class="query-view">
-    <view class="query-content" :style="contentStyle">
-      <view class="query-left">
-        <InputCom
-          ref="orderNoRef"
-          title="任务单号:"
-          type="orderNo"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('orderNo', $event)"
-        />
-        <CheckNatureCom
-          ref="checkTypeRef"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('checkType', $event)"
-        />
-        <CheckDateCom
-          ref="checkDateRef"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('checkDate', $event)"
-        />
-        <!-- <CellCom
-          ref="mainCheckerStrIdsRef"
-          title="主检人:"
-          type="mainCheckerStrIds"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @click="showUserListPopup('主检人', 'mainCheckerStrIds')"
-        />
-        <CellCom
-          ref="managerIdRef"
-          title="项目负责人:"
-          type="managerId"
-          :text-style="{ width: '80px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @click="showUserListPopup('项目负责人', 'managerId')"
-        /> -->
-      </view>
-
-      <view class="query-right">
-        <CellCom
-          ref="queryTypeRef"
-          :title="queryType.value + ':'"
-          :type="queryType.id"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          :default-value="defaultValue"
-          @click="showUserListPopup(queryType.value, queryType.id)"
-        />
-        <InputCom
-          ref="projectNoRef"
-          title="工程号:"
-          type="projectNo"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('projectNo', $event)"
-        />
-        <InputCom
-          ref="unitNameRef"
-          title="单位名称:"
-          type="unitName"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('unitName', $event)"
-        />
-        <!-- <CellCom
-          ref="checkUserStrIdsRef"
-          title="检验员:"
-          type="checkUserStrIds"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @click="showUserListPopup('检验员', 'checkUserStrIds')"
-        /> -->
-
-        <view class="btn-group">
-          <button class="btn reset-btn" @click="reset">重置</button>
-          <button class="btn query-btn" @click="query">查询</button>
-        </view>
-      </view>
-    </view>
-
-    <view class="query-toggle" @click="toggleFilter">
-      <text class="query-toggle-text">查询</text>
-      <image
-        class="arrow-icon"
-        :src="iconMap.ArrowDown"
-        :class="{ 'arrow-rotate': isOpen }"
-      />
-    </view>
-  </view>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, computed } from 'vue'
-import { useUserStore } from '@/store/user'
-import iconMap from '@/utils/imagesMap'
-import { InputCom } from '@/components/QueryViewItem'
-import { CheckDateCom } from '@/components/QueryViewItem'
-import { CheckNatureCom } from '@/components/QueryViewItem'
-import { CellCom } from '@/components/QueryViewItem'
-
-interface Props {
-  queryType: { value: string; id: string }
-}
-
-const props = defineProps<Props>()
-
-const emit = defineEmits<{
-  queryAction: [params: Record<string, any>]
-}>()
-
-const userStore = useUserStore()
-const userInfo = computed(() => userStore.userInfo)
-
-const isOpen = ref(false)
-const params = reactive<Record<string, any>>({
-  orderNo: '',
-  checkType: '',
-  mainCheckerStrIds: '',
-  [props.queryType.id]: userInfo.value?.id || '',
-  checkDate: '',
-  checkUserStrIds: '',
-  projectNo: '',
-  unitName: '',
-  managerId: '',
-})
-
-const defaultValue = computed(() => userInfo.value?.nickname || '')
-
-const contentStyle = computed(() => ({
-  height: isOpen.value ? '220px' : '0',
-  opacity: isOpen.value ? 1 : 0,
-  overflow: 'hidden',
-  transition: 'all 0.3s',
-}))
-
-const orderNoRef = ref<any>(null)
-const checkTypeRef = ref<any>(null)
-const checkDateRef = ref<any>(null)
-const mainCheckerStrIdsRef = ref<any>(null)
-const managerIdRef = ref<any>(null)
-const queryTypeRef = ref<any>(null)
-const projectNoRef = ref<any>(null)
-const unitNameRef = ref<any>(null)
-const checkUserStrIdsRef = ref<any>(null)
-
-const toggleFilter = () => {
-  isOpen.value = !isOpen.value
-}
-
-const handleChange = (propName: string, value: any) => {
-  params[propName] = value
-}
-
-const reset = () => {
-  orderNoRef.value?.reset()
-  checkTypeRef.value?.reset()
-  checkDateRef.value?.reset()
-  mainCheckerStrIdsRef.value?.reset()
-  managerIdRef.value?.reset()
-  projectNoRef.value?.reset()
-  unitNameRef.value?.reset()
-  checkUserStrIdsRef.value?.reset()
-
-  Object.assign(params, {
-    orderNo: '',
-    checkType: '',
-    mainCheckerStrIds: '',
-    [props.queryType.id]: userInfo.value?.id || '',
-    checkDate: '',
-    checkUserStrIds: '',
-    projectNo: '',
-    unitName: '',
-    managerId: '',
-  })
-
-  emit('queryAction', params)
-}
-
-const query = () => {
-  Object.assign(params, {
-    checkType: checkTypeRef.value?.inputContent,
-    checkDate: checkDateRef.value?.inputContent,
-  })
-  emit('queryAction', params)
-}
-
-const showUserListPopup = (title: string, type: string) => {
-  console.log('显示用户列表弹窗:', title, type)
-}
-</script>
-
-<style lang="scss" scoped>
-.query-view {
-  width: 100%;
-  background-color: #fff;
-}
-
-.query-content {
-  display: flex;
-  flex-direction: row;
-  flex-wrap: wrap;
-  justify-content: space-between;
-  padding: 0 15px;
-}
-
-.query-left,
-.query-right {
-  flex: 1;
-  padding: 15px 0;
-}
-
-.query-right {
-  margin-left: 10px;
-}
-
-.btn-group {
-  display: flex;
-  flex-direction: row;
-  justify-content: flex-end;
-  margin-top: 10px;
-  padding: 0 10%;
-  gap: 10%;
-}
-
-.btn {
-  padding: 0 15px;
-  height: 30px;
-  margin-left: 5px;
-  border-radius: 3px;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  font-size: 15px;
-  border: none;
-}
-
-.reset-btn {
-  background-color: #fff;
-  color: rgb(47, 142, 255);
-  border: 1px solid rgb(47, 142, 255);
-}
-
-.query-btn {
-  background-color: rgb(47, 142, 255);
-  color: rgb(222, 238, 255);
-}
-
-.query-toggle {
-  display: flex;
-  flex-direction: row;
-  justify-content: space-between;
-  align-items: center;
-  padding: 0 20px;
-  // height: 60px;
-  border-top: 1px solid rgba(187, 187, 187, 0.8);
-}
-
-.query-toggle-text {
-  color: rgb(51, 51, 51);
-  font-size: 16px;
-}
-
-.arrow-icon {
-  width: 21px;
-  height: 21px;
-  transition: transform 0.3s;
-}
-
-.arrow-rotate {
-  transform: rotate(180deg);
-}
-</style>

+ 32 - 14
src/pages/pendingVerification/components/QueryView.vue

@@ -12,12 +12,17 @@
         />
         <CheckNatureCom
           ref="checkTypeRef"
+          title="检验性质:"
+          type="checkType"
+          :equip-type="equipType"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkType', $event)"
         />
         <CheckDateCom
           ref="checkDateRef"
+          title="检验时间:"
+          type="checkDate"
           :text-style="{ width: '80px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkDate', $event)"
@@ -43,14 +48,15 @@
       <view class="query-right">
         <CellCom
           ref="queryTypeRef"
-          :title="queryType.value + ':'"
-          :type="queryType.id"
+          :title="queryTypeTitle"
+          type="queryType"
           :text-style="{ width: '90px' }"
           :style="{ marginLeft: 0 }"
           :default-value="defaultValue"
-          @click="showUserListPopup(queryType.value, queryType.id)"
+          @click="showUserListPopup(queryTypeTitle, 'queryType')"
         />
         <InputCom
+          v-if="equipType === EquipmentType.BOILER || equipType === EquipmentType.CONTAINER"
           ref="equipCodeRef"
           title="设备注册代码:"
           type="equipCode"
@@ -58,6 +64,15 @@
           :style="{ marginLeft: 0 }"
           @change="handleChange('equipCode', $event)"
         />
+        <InputCom
+          v-if="equipType === EquipmentType.PIPE"
+          ref="projectNoRef"
+          title="工程号:"
+          type="projectNo"
+          :text-style="{ width: '90px' }"
+          :style="{ marginLeft: 0 }"
+          @change="handleChange('projectNo', $event)"
+        />
         <InputCom
           ref="unitNameRef"
           title="单位名称:"
@@ -97,12 +112,14 @@
 import { ref, reactive, computed } from 'vue'
 import { useUserStore } from '@/store/user'
 import iconMap from '@/utils/imagesMap'
+import { EquipmentType } from '@/utils/dictMap'
 import { InputCom } from '@/components/QueryViewItem'
 import { CheckDateCom } from '@/components/QueryViewItem'
 import { CheckNatureCom } from '@/components/QueryViewItem'
 import { CellCom } from '@/components/QueryViewItem'
 
 interface Props {
+  equipType: EquipmentType
   queryType: { value: string; id: string }
 }
 
@@ -115,23 +132,26 @@ const emit = defineEmits<{
 const userStore = useUserStore()
 const userInfo = computed(() => userStore.userInfo)
 
-// 默认收起
 const isOpen = ref(false)
 const params = reactive<Record<string, any>>({
   orderNo: '',
   checkType: '',
   mainCheckerStrIds: '',
-  [props.queryType.id]: userInfo.value?.id || '',
+  queryType: '',
   checkDate: '',
   checkUserStrIds: '',
   equipCode: '',
+  projectNo: '',
   unitName: '',
   managerId: '',
 })
 
 const defaultValue = computed(() => userInfo.value?.nickname || '')
 
-// 内容区域样式(默认收起)
+const queryTypeTitle = computed(() => {
+  return props.queryType.value + ':'
+})
+
 const contentStyle = computed(() => ({
   height: isOpen.value ? '220px' : '0',
   opacity: isOpen.value ? 1 : 0,
@@ -139,7 +159,6 @@ const contentStyle = computed(() => ({
   transition: 'all 0.3s',
 }))
 
-// 组件引用
 const orderNoRef = ref<any>(null)
 const checkTypeRef = ref<any>(null)
 const checkDateRef = ref<any>(null)
@@ -147,27 +166,27 @@ const mainCheckerStrIdsRef = ref<any>(null)
 const managerIdRef = ref<any>(null)
 const queryTypeRef = ref<any>(null)
 const equipCodeRef = ref<any>(null)
+const projectNoRef = ref<any>(null)
 const unitNameRef = ref<any>(null)
 const checkUserStrIdsRef = ref<any>(null)
 
-// 切换筛选
 const toggleFilter = () => {
   isOpen.value = !isOpen.value
 }
 
-// 处理变化
 const handleChange = (propName: string, value: any) => {
   params[propName] = value
 }
 
-// 重置
 const reset = () => {
   orderNoRef.value?.reset()
   checkTypeRef.value?.reset()
   checkDateRef.value?.reset()
   mainCheckerStrIdsRef.value?.reset()
   managerIdRef.value?.reset()
+  queryTypeRef.value?.reset()
   equipCodeRef.value?.reset()
+  projectNoRef.value?.reset()
   unitNameRef.value?.reset()
   checkUserStrIdsRef.value?.reset()
 
@@ -175,10 +194,11 @@ const reset = () => {
     orderNo: '',
     checkType: '',
     mainCheckerStrIds: '',
-    [props.queryType.id]: userInfo.value?.id || '',
+    queryType: '',
     checkDate: '',
     checkUserStrIds: '',
     equipCode: '',
+    projectNo: '',
     unitName: '',
     managerId: '',
   })
@@ -186,18 +206,16 @@ const reset = () => {
   emit('queryAction', params)
 }
 
-// 查询
 const query = () => {
   Object.assign(params, {
     checkType: checkTypeRef.value?.inputContent,
     checkDate: checkDateRef.value?.inputContent,
+    queryType: userInfo.value?.id || '',
   })
   emit('queryAction', params)
 }
 
-// 显示用户列表弹窗
 const showUserListPopup = (title: string, type: string) => {
-  // TODO: 实现用户列表弹窗
   console.log('显示用户列表弹窗:', title, type)
 }
 </script>

+ 3 - 15
src/pages/pendingVerification/list/PendingVerificationList.vue

@@ -18,8 +18,8 @@
     <NavBar title="记录校核" />
 
     <!-- 查询视图 -->
-    <component
-      :is="queryViewComponent"
+    <QueryView
+      :equip-type="equipType"
       :query-type="queryType"
       @query-action="queryAction"
     />
@@ -49,8 +49,7 @@
 import { ref, reactive, computed } from 'vue'
 import { useUserStore } from '@/store/user'
 import { useConfigStore } from '@/store/config'
-import BoilerQueryView from '@/pages/pendingVerification/components/BoilerQueryView.vue'
-import PipeQueryView from '@/pages/pendingVerification/components/PipeQueryView.vue'
+import QueryView from '@/pages/pendingVerification/components/QueryView.vue'
 import BoilerItem from '@/pages/pendingVerification/list/BoilerItem.vue'
 import PipeItem from '@/pages/pendingVerification/list/PipeItem.vue'
 import NavBar from '@/components/NavBar/NavBar.vue'
@@ -87,17 +86,6 @@ const taskItemComponent = computed(() => {
   }
 })
 
-const queryViewComponent = computed(() => {
-  switch (equipType) {
-    case EquipmentType.BOILER:
-      return BoilerQueryView
-    case EquipmentType.PIPE:
-      return PipeQueryView
-    default:
-      return BoilerQueryView
-  }
-})
-
 // 初始化参数
 params.recheckStrIds = userInfo.value?.id || ''
 

+ 0 - 243
src/pages/taskOnlinePage/components/query/PipeQueryView.vue

@@ -1,243 +0,0 @@
-<template>
-  <view class="query-view">
-    <view class="query-content" :style="contentStyle">
-      <view class="query-left">
-        <InputCom
-          ref="orderNoRef"
-          title="任务单号:"
-          type="orderNo"
-          :text-style="{ width: '70px' }"
-          :style="{ marginLeft: 0 }"
-          :default-value="params.orderNo"
-          @change="handleChange('orderNo', $event)"
-        />
-        <InputCom
-          ref="unitNameRef"
-          title="单位名称:"
-          type="unitName"
-          :text-style="{ width: '70px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('unitName', $event)"
-        />
-        <CheckDateCom
-          ref="checkDateRef"
-          type="checkDate"
-          title="检验日期:"
-          :text-style="{ width: '70px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @change="handleChange('checkDate', $event)"
-        />
-      </view>
-
-      <view class="query-right">
-        <InputCom
-          ref="projectNoRef"
-          title="工程号:"
-          type="projectNo"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('projectNo', $event)"
-        />
-        <CheckTaskStatusCom
-          ref="taskStatusListRef"
-          type="taskStatusList"
-          title="主报告状态:"
-          :default-value="[400, 500, 510]"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0 }"
-          @change="handleChange('taskStatusList', $event)"
-        />
-        <CheckNatureCom
-          ref="checkTypeRef"
-          type="checkType"
-          :text-style="{ width: '90px' }"
-          :style="{ marginLeft: 0, marginBottom: 0 }"
-          @change="handleChange('checkType', $event)"
-        />
-
-        <view class="btn-group">
-          <button class="btn reset-btn" @click="reset">重置</button>
-          <button class="btn query-btn" @click="query">查询</button>
-        </view>
-      </view>
-    </view>
-
-    <view class="query-toggle" @click="toggleFilter">
-      <text class="query-toggle-text">查询</text>
-      <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': isOpen }" />
-    </view>
-  </view>
-</template>
-
-<script lang="ts" setup>
-import { ref, reactive, computed } from 'vue'
-import iconMap from '@/utils/imagesMap'
-import { InputCom } from '@/components/QueryViewItem'
-import { CheckDateCom } from '@/components/QueryViewItem'
-import { CheckNatureCom } from '@/components/QueryViewItem'
-import { CheckTaskStatusCom } from '@/components/QueryViewItem'
-
-interface Props {
-  queryType?: Record<string, any>
-}
-
-const props = withDefaults(defineProps<Props>(), {
-  queryType: () => ({}),
-})
-
-const emit = defineEmits<{
-  queryAction: [params: Record<string, any>]
-}>()
-
-// 默认收起
-const isOpen = ref(false)
-const params = reactive<Record<string, any>>({
-  orderNo: '',
-  projectNo: '',
-  unitName: '',
-  taskStatusList: [],
-  productNo: '',
-  checkType: '',
-  checkDate: [],
-  ...props.queryType,
-})
-
-// 内容区域样式(默认收起)
-const contentStyle = computed(() => ({
-  height: isOpen.value ? '170px' : '0',
-  opacity: isOpen.value ? 1 : 0,
-  overflow: 'hidden',
-  transition: 'all 0.3s',
-}))
-
-// 组件引用
-const orderNoRef = ref<any>(null)
-const unitNameRef = ref<any>(null)
-const productNoRef = ref<any>(null)
-const checkDateRef = ref<any>(null)
-const projectNoRef = ref<any>(null)
-const taskStatusListRef = ref<any>(null)
-const checkTypeRef = ref<any>(null)
-
-// 获取查询参数
-const getQueryParams = () => {
-  return { ...params }
-}
-
-defineExpose({
-  getQueryParams,
-})
-
-// 切换筛选
-const toggleFilter = () => {
-  isOpen.value = !isOpen.value
-}
-
-// 处理变化
-const handleChange = (propName: string, value: any) => {
-  params[propName] = value
-}
-
-// 重置
-const reset = () => {
-  orderNoRef.value?.reset()
-  unitNameRef.value?.reset()
-  productNoRef.value?.reset()
-  checkDateRef.value?.reset()
-  projectNoRef.value?.reset()
-  taskStatusListRef.value?.reset()
-  checkTypeRef.value?.reset()
-
-  Object.keys(params).forEach((key) => {
-    delete params[key]
-  })
-  Object.assign(params, { ...props.queryType })
-
-  emit('queryAction', params)
-}
-
-// 查询
-const query = () => {
-  emit('queryAction', params)
-}
-</script>
-
-<style lang="scss" scoped>
-.query-view {
-  width: 100%;
-  background-color: #fff;
-}
-
-.query-content {
-  display: flex;
-  flex-direction: row;
-  flex-wrap: wrap;
-  justify-content: space-between;
-  padding: 0 15px;
-}
-
-.query-left,
-.query-right {
-  flex: 1;
-  padding: 15px 0;
-}
-
-.query-right {
-  margin-left: 10px;
-}
-
-.btn-group {
-  display: flex;
-  flex-direction: row;
-  justify-content: flex-end;
-  margin-top: 10px;
-}
-
-.btn {
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  height: 30px;
-  padding: 0 15px;
-  margin-left: 10%;
-  font-size: 15px;
-  border: none;
-  border-radius: 3px;
-}
-
-.reset-btn {
-  color: rgb(47, 142, 255);
-  background-color: #fff;
-  border: 1px solid rgb(47, 142, 255);
-}
-
-.query-btn {
-  color: rgb(222, 238, 255);
-  background-color: rgb(47, 142, 255);
-}
-
-.query-toggle {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  justify-content: space-between;
-  height: 60px;
-  padding: 0 20px;
-  border-top: 1px solid rgba(187, 187, 187, 0.8);
-}
-
-.query-toggle-text {
-  font-size: 16px;
-  color: rgb(51, 51, 51);
-}
-
-.arrow-icon {
-  width: 21px;
-  height: 21px;
-  transition: transform 0.3s;
-}
-
-.arrow-rotate {
-  transform: rotate(180deg);
-}
-</style>

+ 32 - 18
src/pages/taskOnlinePage/components/query/BoilerQueryView.vue

@@ -8,7 +8,6 @@
           type="orderNo"
           :text-style="{ width: '70px' }"
           :style="{ marginLeft: 0 }"
-          :default-value="params.orderNo"
           @change="handleChange('orderNo', $event)"
         />
         <InputCom
@@ -21,9 +20,9 @@
         />
         <CheckDateCom
           ref="checkDateRef"
+          title="检验日期:"
           type="checkDate"
           :text-style="{ width: '70px' }"
-          title="检验日期:"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @change="handleChange('checkDate', $event)"
         />
@@ -31,6 +30,7 @@
 
       <view class="query-right">
         <InputCom
+          v-if="equipType === EquipmentType.BOILER || equipType === EquipmentType.CONTAINER"
           ref="equipCodeRef"
           title="设备注册代码:"
           type="equipCode"
@@ -38,10 +38,19 @@
           :style="{ marginLeft: 0 }"
           @change="handleChange('equipCode', $event)"
         />
+        <InputCom
+          v-if="equipType === EquipmentType.PIPE"
+          ref="projectNoRef"
+          title="工程号:"
+          type="projectNo"
+          :text-style="{ width: '90px' }"
+          :style="{ marginLeft: 0 }"
+          @change="handleChange('projectNo', $event)"
+        />
         <CheckTaskStatusCom
           ref="taskStatusListRef"
-          type="taskStatusList"
           title="主报告状态:"
+          type="taskStatusList"
           :default-value="[400, 500, 510]"
           :text-style="{ width: '90px' }"
           :style="{ marginLeft: 0 }"
@@ -49,7 +58,9 @@
         />
         <CheckNatureCom
           ref="checkTypeRef"
+          title="检验性质:"
           type="checkType"
+          :equip-type="equipType"
           :text-style="{ width: '90px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @change="handleChange('checkType', $event)"
@@ -72,37 +83,37 @@
 <script lang="ts" setup>
 import { ref, reactive, computed } from 'vue'
 import iconMap from '@/utils/imagesMap'
+import { EquipmentType } from '@/utils/dictMap'
 import { InputCom } from '@/components/QueryViewItem'
 import { CheckDateCom } from '@/components/QueryViewItem'
 import { CheckNatureCom } from '@/components/QueryViewItem'
 import { CheckTaskStatusCom } from '@/components/QueryViewItem'
 
 interface Props {
-  queryType?: Record<string, any>
+  equipType: EquipmentType
+  defaultValues?: Record<string, any>
 }
 
 const props = withDefaults(defineProps<Props>(), {
-  queryType: () => ({}),
+  defaultValues: () => ({}),
 })
 
 const emit = defineEmits<{
   queryAction: [params: Record<string, any>]
 }>()
 
-// 默认收起
 const isOpen = ref(false)
 const params = reactive<Record<string, any>>({
   orderNo: '',
   equipCode: '',
   unitName: '',
   taskStatusList: [],
-  productNo: '',
+  projectNo: '',
   checkType: '',
   checkDate: [],
-  ...props.queryType,
+  ...props.defaultValues,
 })
 
-// 内容区域样式(默认收起)
 const contentStyle = computed(() => ({
   height: isOpen.value ? '170px' : '0',
   opacity: isOpen.value ? 1 : 0,
@@ -110,16 +121,14 @@ const contentStyle = computed(() => ({
   transition: 'all 0.3s',
 }))
 
-// 组件引用
 const orderNoRef = ref<any>(null)
 const unitNameRef = ref<any>(null)
-const productNoRef = ref<any>(null)
 const checkDateRef = ref<any>(null)
 const equipCodeRef = ref<any>(null)
+const projectNoRef = ref<any>(null)
 const taskStatusListRef = ref<any>(null)
 const checkTypeRef = ref<any>(null)
 
-// 获取查询参数
 const getQueryParams = () => {
   return { ...params }
 }
@@ -128,35 +137,40 @@ defineExpose({
   getQueryParams,
 })
 
-// 切换筛选
 const toggleFilter = () => {
   isOpen.value = !isOpen.value
 }
 
-// 处理变化
 const handleChange = (propName: string, value: any) => {
   params[propName] = value
 }
 
-// 重置
 const reset = () => {
   orderNoRef.value?.reset()
   unitNameRef.value?.reset()
-  productNoRef.value?.reset()
   checkDateRef.value?.reset()
   equipCodeRef.value?.reset()
+  projectNoRef.value?.reset()
   taskStatusListRef.value?.reset()
   checkTypeRef.value?.reset()
 
   Object.keys(params).forEach((key) => {
     delete params[key]
   })
-  Object.assign(params, { ...props.queryType })
+  Object.assign(params, {
+    orderNo: '',
+    equipCode: '',
+    unitName: '',
+    taskStatusList: [],
+    projectNo: '',
+    checkType: '',
+    checkDate: [],
+    ...props.defaultValues,
+  })
 
   emit('queryAction', params)
 }
 
-// 查询
 const query = () => {
   emit('queryAction', params)
 }

+ 4 - 16
src/pages/taskOnlinePage/taskOnline.vue

@@ -18,10 +18,10 @@
     <NavBar title="在线录入" />
 
     <!-- 查询视图 -->
-    <component
-      :is="queryViewComponent"
+    <QueryView
       ref="queryViewRef"
-      :query-type="defaultTypeValue"
+      :equip-type="equipType"
+      :default-values="defaultTypeValue"
       @query-action="queryAction"
     />
 
@@ -58,8 +58,7 @@
 <script lang="ts" setup>
 import { ref, reactive, computed, onMounted } from 'vue'
 import { useUserStore } from '@/store/user'
-import BoilerQueryView from './components/query/BoilerQueryView.vue'
-import PipeQueryView from './components/query/PipeQueryView.vue'
+import QueryView from './components/query/QueryView.vue'
 import RadioFilterBar from '@/components/RadioFilterBar/RadioFilterBar.vue'
 import { useConfigStore } from '@/store/config'
 import { TaskOrderFuncName, requestFunc } from '@/api/ApiRouter/taskOrder'
@@ -106,17 +105,6 @@ const taskItemComponent = computed(() => {
   }
 })
 
-const queryViewComponent = computed(() => {
-  switch (equipType) {
-    case EquipmentType.BOILER:
-      return BoilerQueryView
-    case EquipmentType.PIPE:
-      return PipeQueryView
-    default:
-      return null
-  }
-})
-
 // 默认查询参数
 const defaultTypeValue = computed(() => ({
   orderNo: '',

+ 1 - 0
src/pages/unClaim/components/query/QueryView.vue

@@ -43,6 +43,7 @@
         <CheckNatureCom
           ref="checkTypeRef"
           type="checkType"
+          title="检验性质:"
           :text-style="{ width: '90px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @change="handleChange('checkType', $event)"