Jelajahi Sumber

调整QueryView的UI样式

yangguanjin 2 hari lalu
induk
melakukan
af020e4522

+ 2 - 2
src/components/QueryViewItem/CellCom.vue

@@ -61,7 +61,7 @@ const handleClick = () => {
 
 .ic-title {
   color: rgb(51, 51, 51);
-  font-size: 12px;
+  font-size: 14px;
   width: 60px;
   text-align: right;
 }
@@ -78,6 +78,6 @@ const handleClick = () => {
 
 .ic-text {
   color: rgba(136, 136, 136, 1);
-  font-size: 12px;
+  font-size: 14px;
 }
 </style>

+ 2 - 2
src/components/QueryViewItem/CheckDateCom.vue

@@ -87,7 +87,7 @@ defineExpose({
 .title {
   flex-shrink: 0;
   width: 60px;
-  font-size: 12px;
+  font-size: 14px;
   color: rgb(51, 51, 51);
   text-align: right;
 }
@@ -111,7 +111,7 @@ defineExpose({
 }
 
 .date-text {
-  font-size: 12px;
+  font-size: 14px;
   color: rgb(51, 51, 51);
 
   &--placeholder {

+ 2 - 2
src/components/QueryViewItem/CheckNatureCom.vue

@@ -102,7 +102,7 @@ defineExpose({
 .title {
   flex-shrink: 0;
   width: 60px;
-  font-size: 12px;
+  font-size: 14px;
   color: rgb(51, 51, 51);
   text-align: right;
 }
@@ -127,7 +127,7 @@ defineExpose({
 }
 
 .nature-text {
-  font-size: 12px;
+  font-size: 14px;
   color: rgb(51, 51, 51);
 
   &--placeholder {

+ 5 - 5
src/components/QueryViewItem/CheckTaskStatusCom.vue

@@ -158,7 +158,7 @@ const confirmSelection = () => {
 
 .title {
   width: 90px;
-  font-size: 12px;
+  font-size: 14px;
   color: rgb(51, 51, 51);
   text-align: right;
 }
@@ -195,7 +195,7 @@ const confirmSelection = () => {
 }
 
 .count-text {
-  font-size: 12px;
+  font-size: 14px;
   font-weight: 500;
   color: white;
 }
@@ -210,7 +210,7 @@ const confirmSelection = () => {
 }
 
 .tag-text {
-  font-size: 12px;
+  font-size: 14px;
   color: #2f8eff;
   white-space: nowrap;
 }
@@ -221,7 +221,7 @@ const confirmSelection = () => {
 }
 
 .placeholder-text {
-  font-size: 12px;
+  font-size: 14px;
   color: rgba(136, 136, 136, 1);
 }
 
@@ -247,7 +247,7 @@ const confirmSelection = () => {
   display: flex;
   flex-direction: row;
   align-items: center;
-  padding: 12px 0;
+  padding: 14px 0;
   border-bottom: 1px solid #f5f5f5;
 }
 

+ 118 - 0
src/components/QueryViewItem/EquipTypeCom.vue

@@ -0,0 +1,118 @@
+<template>
+  <view class="equip-type-box">
+    <text class="title" :style="textStyle">{{ title }}</text>
+    <wd-picker
+      class="equip-type-picker"
+      v-model="selectValue"
+      :columns="columns"
+      @change="onChange"
+    >
+      <view class="equip-type-input">
+        <text :class="['equip-type-text', { 'equip-type-text--placeholder': !displayLabel }]">
+          {{ displayLabel || '请选择' }}
+        </text>
+      </view>
+    </wd-picker>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref, computed } from 'vue'
+
+interface EquipTypeItem {
+  label: string
+  value: string | number
+}
+
+interface Props {
+  title: string
+  type?: string
+  defaultValue?: string | number
+  textStyle?: any
+  columns?: EquipTypeItem[]
+}
+
+const props = withDefaults(defineProps<Props>(), {
+  title: '设备类别:',
+  type: 'equipType',
+  defaultValue: '',
+  columns: () => [
+    { label: '全部', value: '' },
+    { label: '压力容器', value: '1' },
+    { label: '锅炉', value: '2' },
+    { label: '管道', value: '3' },
+  ],
+})
+
+const emit = defineEmits<{
+  change: [value: string | number, type: string]
+}>()
+
+const selectValue = ref<string | number>(props.defaultValue)
+
+const displayLabel = computed(() => {
+  if (!selectValue.value) return ''
+  const item = props.columns.find((c) => c.value === selectValue.value)
+  return item?.label || ''
+})
+
+const onChange = ({ selectedItem }: { selectedItem: EquipTypeItem }) => {
+  selectValue.value = selectedItem.value
+  emit('change', selectedItem.value, props.type)
+}
+
+defineExpose({
+  reset: () => {
+    selectValue.value = ''
+  },
+  inputContent: computed(() => selectValue.value || ''),
+  getValue: () => selectValue.value,
+  setValue: (value: string | number) => {
+    selectValue.value = value
+  },
+})
+</script>
+
+<style lang="scss" scoped>
+.equip-type-box {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-bottom: 14px;
+}
+
+.title {
+  color: rgb(51, 51, 51);
+  font-size: 14px;
+  text-align: right;
+  flex-shrink: 0;
+}
+
+.equip-type-picker {
+  flex: 1;
+  min-width: 0;
+}
+
+.equip-type-input {
+  box-sizing: border-box;
+  display: flex;
+  flex: 1;
+  flex-direction: row;
+  align-items: center;
+  min-width: 0;
+  height: 30px;
+  min-height: 30px;
+  padding: 0 5px;
+  border: 1px solid #ccc;
+  border-radius: 6px;
+}
+
+.equip-type-text {
+  font-size: 14px;
+  color: rgb(51, 51, 51);
+
+  &--placeholder {
+    color: rgba(136, 136, 136, 1);
+  }
+}
+</style>

+ 2 - 2
src/components/QueryViewItem/InputCom.vue

@@ -67,7 +67,7 @@ const handleInput = (e: any) => {
 
 .ic-title {
   color: rgb(51, 51, 51);
-  font-size: 12px;
+  font-size: 14px;
   text-align: right;
   flex-shrink: 0;
 }
@@ -78,7 +78,7 @@ const handleInput = (e: any) => {
   height: 30px;
   border: 1px solid #ccc;
   color: rgba(136, 136, 136, 1);
-  font-size: 12px;
+  font-size: 14px;
   border-radius: 6px;
   padding: 0 5px;
 }

+ 116 - 0
src/components/QueryViewItem/SelectCom.vue

@@ -0,0 +1,116 @@
+<template>
+  <view class="select-com-box">
+    <text class="title" :style="textStyle">{{ title }}</text>
+    <wd-picker
+      class="select-picker"
+      v-model="selectValue"
+      :columns="columns"
+      @confirm="onConfirm"
+    >
+      <view class="select-input">
+        <text :class="['select-text', { 'select-text--placeholder': !displayLabel }]">
+          {{ displayLabel || placeholder }}
+        </text>
+      </view>
+    </wd-picker>
+  </view>
+</template>
+
+<script lang="ts" setup>
+import { ref, computed } from 'vue'
+
+interface SelectItem {
+  label: string
+  value: string | number
+}
+
+interface Props {
+  title: string
+  type?: string
+  placeholder?: string
+  defaultValue?: string | number
+  textStyle?: any
+  columns?: SelectItem[]
+}
+
+const props = withDefaults(defineProps<Props>(), {
+  title: '请选择:',
+  type: 'select',
+  placeholder: '请选择',
+  defaultValue: '',
+  columns: () => [],
+})
+
+const emit = defineEmits<{
+  change: [value: string | number, type: string]
+}>()
+
+const selectValue = ref<string | number>(props.defaultValue)
+
+const displayLabel = computed(() => {
+  if (!selectValue.value && selectValue.value !== 0) return ''
+  const item = props.columns.find((c) => c.value === selectValue.value)
+  return item?.label || ''
+})
+
+const onConfirm = ({ selectedItem }: { selectedItem: SelectItem }) => {
+  selectValue.value = selectedItem.value
+  emit('change', selectedItem.value, props.type)
+}
+
+defineExpose({
+  reset: () => {
+    selectValue.value = props.defaultValue
+  },
+  inputContent: computed(() => selectValue.value || ''),
+  getValue: () => selectValue.value,
+  setValue: (value: string | number) => {
+    selectValue.value = value
+  },
+})
+</script>
+
+<style lang="scss" scoped>
+.select-com-box {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  margin-bottom: 14px;
+}
+
+.title {
+  flex-shrink: 0;
+  width: 100px;
+  font-size: 14px;
+  color: #666;
+  text-align: right;
+  margin-right: 5px;
+}
+
+.select-picker {
+  flex: 1;
+  min-width: 0;
+}
+
+.select-input {
+  box-sizing: border-box;
+  display: flex;
+  flex: 1;
+  flex-direction: row;
+  align-items: center;
+  min-width: 0;
+  height: 36px;
+  padding: 0 10px;
+  border: 1px solid #ddd;
+  border-radius: 4px;
+}
+
+.select-text {
+  font-size: 14px;
+  color: #333;
+
+  &--placeholder {
+    color: rgba(136, 136, 136, 1);
+  }
+}
+</style>

+ 2 - 0
src/components/QueryViewItem/index.ts

@@ -3,3 +3,5 @@ export { default as CheckDateCom } from './CheckDateCom.vue'
 export { default as CheckNatureCom } from './CheckNatureCom.vue'
 export { default as CellCom } from './CellCom.vue'
 export { default as CheckTaskStatusCom } from './CheckTaskStatusCom.vue'
+export { default as EquipTypeCom } from './EquipTypeCom.vue'
+export { default as SelectCom } from './SelectCom.vue'

+ 10 - 4
src/components/SpreadDesigner/spreadDesigner.vue

@@ -1,7 +1,7 @@
 <template>
   <view class="spread-designer">
     <NavBar>
-      <template #title>
+      <!-- <template #title>
         <view class="nav-title-wrapper">
           <select
             v-if="reportList && reportList.length > 0"
@@ -15,7 +15,7 @@
             </option>
           </select>
         </view>
-      </template>
+      </template> -->
       <template #right>
         <button class="nav-btn primary" @click="saveRecord">记录保存</button>
       </template>
@@ -333,7 +333,13 @@ function deepMergeSchemaValue(target, source) {
             ? targetValue
             : deepMergeSchemaValue(targetValue, sourceValue)
       } else if (sourceValue !== undefined && sourceValue !== '') {
-        result[key] = sourceValue
+        const trimmedSourceValue = sourceValue.trim()
+        // JSON字符串需要解析为对象或数组
+        if (typeof trimmedSourceValue === 'string' && (trimmedSourceValue.startsWith("{") || trimmedSourceValue.startsWith("["))) {
+          result[key] = JSON.parse(trimmedSourceValue)
+        } else {
+          result[key] = trimmedSourceValue
+        }
       }
     }
   }
@@ -859,7 +865,7 @@ function handleWorkbookInitialized(spreadInstance) {
     initFieldNameMapping()
     openAndEditRecordFn()
   } else {
-    console.error('没有获取到checkItemData')
+    console.warn('没有获取到checkItemData')
   }
 }
 

+ 7 - 1
src/components/SpreadDesigner/spreadDesignerGeneric.vue

@@ -327,7 +327,13 @@ function deepMergeSchemaValue(target, source) {
             ? targetValue
             : deepMergeSchemaValue(targetValue, sourceValue)
       } else if (sourceValue !== undefined && sourceValue !== '') {
-        result[key] = sourceValue
+        const trimmedSourceValue = sourceValue.trim()
+        // JSON字符串需要解析为对象或数组
+        if (typeof trimmedSourceValue === 'string' && (trimmedSourceValue.startsWith("{") || trimmedSourceValue.startsWith("["))) {
+          result[key] = JSON.parse(trimmedSourceValue)
+        } else {
+          result[key] = trimmedSourceValue
+        }
       }
     }
   }

+ 39 - 49
src/pages/deviceExam/components/query/QueryView.vue

@@ -1,20 +1,21 @@
 <template>
   <view class="query-form-header" @click="toggleFilter">
-    <text class="query-title">查询条件</text>
-    <text class="query-arrow">{{ isOpen ? '▲' : '▼' }}</text>
+    <text class="query-title">查询</text>
+    <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': isOpen }" />
   </view>
   <view class="query-form" :style="contentStyle">
-    <view class="form-item">
-      <text class="form-label">设备类别</text>
-      <wd-picker
-        v-model="selectedTypeValue"
-        :columns="equipmentTypesColumn"
-        @change="onTypeChange"
-      />
-    </view>
+    <EquipTypeCom
+      ref="equipTypeRef"
+      title="设备类别:"
+      type="type"
+      :columns="equipmentTypes"
+      :text-style="{ width: '100px' }"
+      :style="{ marginLeft: 0 }"
+      @change="handleEquipTypeChange"
+    />
     <InputCom
       ref="equipNameRef"
-      title="设备名称"
+      title="设备名称"
       type="equipName"
       :text-style="{ width: '100px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
@@ -23,7 +24,7 @@
     />
     <InputCom
       ref="equipCodeRef"
-      title="设备注册代码"
+      title="设备注册代码"
       type="equipCode"
       :text-style="{ width: '100px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
@@ -32,7 +33,7 @@
     />
     <InputCom
       ref="productNoRef"
-      title="出厂编号"
+      title="出厂编号"
       type="productNo"
       :text-style="{ width: '100px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
@@ -41,7 +42,7 @@
     />
     <InputCom
       ref="unitNameRef"
-      title="使用单位"
+      title="使用单位"
       type="unitName"
       :text-style="{ width: '100px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
@@ -50,7 +51,7 @@
     />
     <InputCom
       ref="unitInnerNoRef"
-      title="单位内编号"
+      title="单位内编号"
       type="unitInnerNo"
       :text-style="{ width: '100px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
@@ -59,7 +60,7 @@
     />
     <InputCom
       ref="useRegisterNoRef"
-      title="使用证编号"
+      title="使用证编号"
       type="useRegisterNo"
       :text-style="{ width: '100px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
@@ -76,6 +77,8 @@
 <script lang="ts" setup>
 import { ref, reactive, computed } from 'vue'
 import { InputCom } from '@/components/QueryViewItem'
+import { EquipTypeCom } from '@/components/QueryViewItem'
+import iconMap from '@/utils/imagesMap'
 
 const emit = defineEmits<{
   queryAction: [params: Record<string, any>]
@@ -93,25 +96,22 @@ const params = reactive({
   useRegisterNo: '',
 })
 
-const selectedType = ref<any>(null)
-const selectedTypeValue = ref('')
-const equipmentTypes = ref([
+const equipmentTypes = [
   { label: '全部', value: '' },
   { label: '压力容器', value: '1' },
   { label: '锅炉', value: '2' },
   { label: '管道', value: '3' },
-])
-const equipmentTypesColumn = computed(() => [
-  equipmentTypes.value.map((item) => ({ label: item.label, value: item.value })),
-])
+]
 
 const contentStyle = computed(() => ({
   height: isOpen.value ? 'auto' : '0',
   opacity: isOpen.value ? 1 : 0,
+  padding: isOpen.value ? '15px' : '0',
   overflow: 'hidden',
-  transition: 'all 0.3s',
+  transition: 'all 0.5s',
 }))
 
+const equipTypeRef = ref<any>(null)
 const equipNameRef = ref<any>(null)
 const equipCodeRef = ref<any>(null)
 const productNoRef = ref<any>(null)
@@ -123,11 +123,8 @@ const toggleFilter = () => {
   isOpen.value = !isOpen.value
 }
 
-const onTypeChange = ({ selected }: { selected: number[] }) => {
-  const index = selected[0]
-  selectedType.value = equipmentTypes.value[index]
-  params.type = selectedType.value?.value || ''
-  selectedTypeValue.value = selectedType.value?.value || ''
+const handleEquipTypeChange = (value: string | number) => {
+  params.type = value as string
 }
 
 const handleChange = (propName: string, value: string) => {
@@ -142,9 +139,8 @@ const handleReset = () => {
   params.unitName = ''
   params.unitInnerNo = ''
   params.useRegisterNo = ''
-  selectedType.value = null
-  selectedTypeValue.value = ''
 
+  equipTypeRef.value?.reset()
   equipNameRef.value?.reset()
   equipCodeRef.value?.reset()
   productNoRef.value?.reset()
@@ -176,8 +172,8 @@ defineExpose({
 }
 
 .query-title {
-  font-size: 14px;
-  color: #333;
+  font-size: 16px;
+  color: rgb(51, 51, 51);
 }
 
 .query-arrow {
@@ -186,26 +182,10 @@ defineExpose({
 }
 
 .query-form {
-  padding: 15px;
   background-color: #fff;
   border-bottom: 1px solid #eee;
 }
 
-.form-item {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  margin-bottom: 12px;
-}
-
-.form-label {
-  width: 100px;
-  font-size: 14px;
-  color: #666;
-  text-align: right;
-  margin-right: 5px;
-}
-
 .form-actions {
   display: flex;
   flex-direction: row;
@@ -233,4 +213,14 @@ defineExpose({
   color: #fff;
   background-color: #2f8eff;
 }
+
+.arrow-icon {
+  width: 21px;
+  height: 21px;
+  transition: transform 0.3s;
+}
+
+.arrow-rotate {
+  transform: rotate(180deg);
+}
 </style>

+ 18 - 20
src/pages/equipment/detail/equipCheckRecordEditor.vue

@@ -30,11 +30,7 @@
 import { ref } from 'vue'
 import SpreadDesigner from '@/components/SpreadDesigner/spreadDesigner.vue'
 import { onLoad } from '@dcloudio/uni-app'
-import {
-  getCheckerEquipmentDetailById,
-  getDynamicTbVal,
-  saveDynamicTbVal,
-} from '@/api/task'
+import { getCheckerEquipmentDetailById, getDynamicTbVal, saveDynamicTbVal } from '@/api/task'
 import { getStandardTemplate } from '@/api/index'
 import { buildFileUrl } from '@/utils/index'
 import { PressureCheckerMyTaskStatus } from '@/utils/dictMap'
@@ -150,21 +146,25 @@ const getDetail = async () => {
     const result = await getCheckerEquipmentDetailById({ id: orderItemId })
     if (result) {
       const resData = (result as any).data
-      const filteredReportList = resData.reportList
-        .map((item: any) => ({
-          ...item,
-          equipId: resData.taskOrderItem.equipId,
-          equipCode: resData.taskOrderItem.equipCode,
-        }))
-        .filter((item: any) =>
-          [
-            PressureCheckerMyTaskStatus.CONFIRMED,
-            PressureCheckerMyTaskStatus.RECORD_INPUT,
-          ].includes(item.taskStatus),
-        )
+      const resDataReportList = resData?.reportList
+      let filteredReportList = []
+      if (resDataReportList) {
+        filteredReportList = resDataReportList
+          .map((item: any) => ({
+            ...item,
+            equipId: resData.taskOrderItem.equipId,
+            equipCode: resData.taskOrderItem.equipCode,
+          }))
+          .filter((item: any) =>
+            [
+              PressureCheckerMyTaskStatus.CONFIRMED,
+              PressureCheckerMyTaskStatus.RECORD_INPUT,
+            ].includes(item.taskStatus),
+          )
+      }
 
       reportList.value = filteredReportList
-      taskOrderItem.value = resData.taskOrderItem
+      taskOrderItem.value = resData?.taskOrderItem
     }
   }
 }
@@ -325,8 +325,6 @@ onLoad((options: any) => {
   equipCode = options.equipCode || ''
   reportUrlParam = options.reportUrl || ''
 
-  console.log('params...........', options)
-
   if (!checkItemId) {
     console.error('checkItemId 为空')
     uni.navigateBack()

+ 10 - 10
src/pages/pendingVerification/components/QueryView.vue

@@ -6,7 +6,7 @@
           ref="orderNoRef"
           title="任务单号:"
           type="orderNo"
-          :text-style="{ width: '80px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('orderNo', $event)"
         />
@@ -15,7 +15,7 @@
           title="检验性质:"
           type="checkType"
           :equip-type="equipType"
-          :text-style="{ width: '80px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkType', $event)"
         />
@@ -23,7 +23,7 @@
           ref="checkDateRef"
           title="检验时间:"
           type="checkDate"
-          :text-style="{ width: '80px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('checkDate', $event)"
         />
@@ -31,7 +31,7 @@
           ref="mainCheckerStrIdsRef"
           title="主检人:"
           type="mainCheckerStrIds"
-          :text-style="{ width: '80px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @click="showUserListPopup('主检人', 'mainCheckerStrIds')"
         />
@@ -39,7 +39,7 @@
           ref="managerIdRef"
           title="项目负责人:"
           type="managerId"
-          :text-style="{ width: '80px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @click="showUserListPopup('项目负责人', 'managerId')"
         />
@@ -50,7 +50,7 @@
           ref="queryTypeRef"
           :title="queryTypeTitle"
           type="queryType"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           :default-value="defaultValue"
           @click="showUserListPopup(queryTypeTitle, 'queryType')"
@@ -60,7 +60,7 @@
           ref="equipCodeRef"
           title="设备注册代码:"
           type="equipCode"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('equipCode', $event)"
         />
@@ -69,7 +69,7 @@
           ref="projectNoRef"
           title="工程号:"
           type="projectNo"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('projectNo', $event)"
         />
@@ -77,7 +77,7 @@
           ref="unitNameRef"
           title="单位名称:"
           type="unitName"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('unitName', $event)"
         />
@@ -85,7 +85,7 @@
           ref="checkUserStrIdsRef"
           title="检验员:"
           type="checkUserStrIds"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @click="showUserListPopup('检验员', 'checkUserStrIds')"
         />

+ 12 - 35
src/pages/systemFile/components/query/QueryView.vue

@@ -4,14 +4,13 @@
     <text class="query-arrow">{{ isOpen ? '▲' : '▼' }}</text>
   </view>
   <view class="query-form" :style="contentStyle">
-    <view class="form-item">
-      <text class="form-label">文件类型</text>
-      <wd-picker
-        v-model="selectedTypeValue"
-        :columns="fileTypesColumn"
-        @change="onTypeChange"
-      />
-    </view>
+    <SelectCom
+      ref="fileTypeRef"
+      title="文件类型"
+      type="type"
+      :columns="fileTypes"
+      @change="handleFileTypeChange"
+    />
     <InputCom
       ref="nameRef"
       title="文件名称"
@@ -40,6 +39,7 @@
 <script lang="ts" setup>
 import { ref, reactive, computed } from 'vue'
 import { InputCom } from '@/components/QueryViewItem'
+import { SelectCom } from '@/components/QueryViewItem'
 
 const emit = defineEmits<{
   queryAction: [params: Record<string, any>]
@@ -53,8 +53,6 @@ const params = reactive({
   docNum: '',
 })
 
-const selectedType = ref<any>({ label: '标准文件', value: 1 })
-const selectedTypeValue = ref(1)
 const fileTypes = [
   { label: '标准文件', value: 1 },
   { label: '作业指导书', value: 2 },
@@ -64,9 +62,6 @@ const fileTypes = [
   { label: '质量记录', value: 6 },
   { label: '外来文件', value: 7 },
 ]
-const fileTypesColumn = computed(() => [
-  fileTypes.map((item) => ({ label: item.label, value: item.value })),
-])
 
 const contentStyle = computed(() => ({
   height: isOpen.value ? 'auto' : '0',
@@ -75,6 +70,7 @@ const contentStyle = computed(() => ({
   transition: 'all 0.3s',
 }))
 
+const fileTypeRef = ref<any>(null)
 const nameRef = ref<any>(null)
 const docNumRef = ref<any>(null)
 
@@ -82,11 +78,8 @@ const toggleFilter = () => {
   isOpen.value = !isOpen.value
 }
 
-const onTypeChange = ({ selected }: { selected: number[] }) => {
-  const index = selected[0]
-  selectedType.value = fileTypes[index]
-  params.type = selectedType.value?.value || 1
-  selectedTypeValue.value = selectedType.value?.value || 1
+const handleFileTypeChange = (value: string | number) => {
+  params.type = value as number
 }
 
 const handleChange = (propName: string, value: string) => {
@@ -97,9 +90,8 @@ const handleReset = () => {
   params.type = 1
   params.name = ''
   params.docNum = ''
-  selectedType.value = fileTypes[0]
-  selectedTypeValue.value = 1
 
+  fileTypeRef.value?.reset()
   nameRef.value?.reset()
   docNumRef.value?.reset()
 
@@ -142,21 +134,6 @@ defineExpose({
   border-bottom: 1px solid #eee;
 }
 
-.form-item {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-  margin-bottom: 12px;
-}
-
-.form-label {
-  width: 80px;
-  font-size: 14px;
-  color: #666;
-  text-align: right;
-  margin-right: 5px;
-}
-
 .form-actions {
   display: flex;
   flex-direction: row;

+ 7 - 7
src/pages/taskOnlinePage/components/query/QueryView.vue

@@ -6,7 +6,7 @@
           ref="orderNoRef"
           title="任务单号:"
           type="orderNo"
-          :text-style="{ width: '70px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('orderNo', $event)"
         />
@@ -14,7 +14,7 @@
           ref="unitNameRef"
           title="单位名称:"
           type="unitName"
-          :text-style="{ width: '70px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('unitName', $event)"
         />
@@ -22,7 +22,7 @@
           ref="checkDateRef"
           title="检验日期:"
           type="checkDate"
-          :text-style="{ width: '70px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @change="handleChange('checkDate', $event)"
         />
@@ -34,7 +34,7 @@
           ref="equipCodeRef"
           title="设备注册代码:"
           type="equipCode"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('equipCode', $event)"
         />
@@ -43,7 +43,7 @@
           ref="projectNoRef"
           title="工程号:"
           type="projectNo"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('projectNo', $event)"
         />
@@ -52,7 +52,7 @@
           title="主报告状态:"
           type="taskStatusList"
           :default-value="[400, 500, 510]"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0 }"
           @change="handleChange('taskStatusList', $event)"
         />
@@ -61,7 +61,7 @@
           title="检验性质:"
           type="checkType"
           :equip-type="equipType"
-          :text-style="{ width: '90px' }"
+          :text-style="{ width: '100px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
           @change="handleChange('checkType', $event)"
         />

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

@@ -43,6 +43,7 @@
         <CheckNatureCom
           ref="checkTypeRef"
           type="checkType"
+          :equip-type="equipType"
           title="检验性质:"
           :text-style="{ width: '90px' }"
           :style="{ marginLeft: 0, marginBottom: 0 }"
@@ -81,9 +82,11 @@ import { CheckDateCom } from '@/components/QueryViewItem'
 import { CheckNatureCom } from '@/components/QueryViewItem'
 import { CellCom } from '@/components/QueryViewItem'
 import SelectUserModal from '@/components/SelectUserByDepart/components/SelectUserModal.vue'
+import { EquipmentType } from '@/utils/dictMap'
 
 interface Props {
   queryType?: Record<string, any>
+  equipType: EquipmentType
 }
 
 const props = withDefaults(defineProps<Props>(), {

+ 6 - 1
src/pages/unClaim/unClaimList.vue

@@ -19,7 +19,12 @@
 
     <!-- 查询视图 -->
     <view class="query-view-wrapper">
-      <QueryView ref="queryViewRef" :query-type="defaultTypeValue" @query-action="queryAction" />
+      <QueryView
+        ref="queryViewRef"
+        :equip-type="equipType"
+        :query-type="defaultTypeValue"
+        @query-action="queryAction"
+      />
     </view>
 
     <!-- 筛选条件栏 -->

+ 25 - 13
src/pages/unitQuery/components/query/QueryView.vue

@@ -1,41 +1,41 @@
 <template>
   <view class="query-form-header" @click="toggleFilter">
-    <text class="query-title">查询条件</text>
-    <text class="query-arrow">{{ isOpen ? '▲' : '▼' }}</text>
+    <text class="query-title">查询</text>
+    <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': isOpen }" />
   </view>
   <view class="query-form" :style="contentStyle">
     <InputCom
       ref="nameRef"
-      title="单位名称"
+      title="单位名称"
       type="name"
-      :text-style="{ width: '120px', textAlign: 'right' }"
+      :text-style="{ width: '140px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
       placeholder="请输入单位名称"
       @change="handleChange('name', $event)"
     />
     <InputCom
       ref="socialCreditCodeRef"
-      title="统一社会信用代码"
+      title="统一社会信用代码"
       type="socialCreditCode"
-      :text-style="{ width: '120px', textAlign: 'right' }"
+      :text-style="{ width: '140px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
       placeholder="请输入统一社会信用代码"
       @change="handleChange('socialCreditCode', $event)"
     />
     <InputCom
       ref="contactRef"
-      title="默认联系人"
+      title="默认联系人"
       type="contact"
-      :text-style="{ width: '120px', textAlign: 'right' }"
+      :text-style="{ width: '140px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
       placeholder="请输入默认联系人"
       @change="handleChange('contact', $event)"
     />
     <InputCom
       ref="telRef"
-      title="默认联系人电话"
+      title="默认联系人电话"
       type="tel"
-      :text-style="{ width: '120px', textAlign: 'right' }"
+      :text-style="{ width: '140px', textAlign: 'right' }"
       :style="{ marginLeft: 0 }"
       placeholder="请输入默认联系人电话"
       @change="handleChange('tel', $event)"
@@ -50,6 +50,7 @@
 <script lang="ts" setup>
 import { ref, reactive, computed } from 'vue'
 import { InputCom } from '@/components/QueryViewItem'
+import iconMap from '@/utils/imagesMap'
 
 const emit = defineEmits<{
   queryAction: [params: Record<string, any>]
@@ -67,8 +68,9 @@ const params = reactive({
 const contentStyle = computed(() => ({
   height: isOpen.value ? 'auto' : '0',
   opacity: isOpen.value ? 1 : 0,
+  padding: isOpen.value ? '15px' : '0',
   overflow: 'hidden',
-  transition: 'all 0.3s',
+  transition: 'all 0.5s',
 }))
 
 const nameRef = ref<any>(null)
@@ -119,8 +121,8 @@ defineExpose({
 }
 
 .query-title {
-  font-size: 14px;
-  color: #333;
+  font-size: 16px;
+  color: rgb(51, 51, 51);
 }
 
 .query-arrow {
@@ -161,4 +163,14 @@ defineExpose({
   color: #fff;
   background-color: #2f8eff;
 }
+
+.arrow-icon {
+  width: 21px;
+  height: 21px;
+  transition: transform 0.3s;
+}
+
+.arrow-rotate {
+  transform: rotate(180deg);
+}
 </style>