|
|
@@ -4,68 +4,87 @@
|
|
|
<image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': isOpen }" />
|
|
|
</view>
|
|
|
<view class="query-form" :style="contentStyle">
|
|
|
- <EquipTypeCom
|
|
|
- ref="equipTypeRef"
|
|
|
- title="设备类别:"
|
|
|
- type="type"
|
|
|
- :columns="equipmentTypes"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0 }"
|
|
|
- @change="handleEquipTypeChange"
|
|
|
- />
|
|
|
+ <view class="equip-type-row">
|
|
|
+ <text class="equip-type-label" :style="{ width: '100px' }">设备类型:</text>
|
|
|
+ <RadioFilterBar
|
|
|
+ v-model="equipTypeCodeModel"
|
|
|
+ :options="equipmentTypes"
|
|
|
+ type="radio"
|
|
|
+ :margin-left="'20px'"
|
|
|
+ class="equip-type-radio"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
<InputCom
|
|
|
- ref="equipNameRef"
|
|
|
+ v-if="equipTypeCode == '200'"
|
|
|
+ v-model="params.equipName"
|
|
|
title="设备名称:"
|
|
|
type="equipName"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
placeholder="请输入设备名称"
|
|
|
- @change="handleChange('equipName', $event)"
|
|
|
/>
|
|
|
<InputCom
|
|
|
- ref="equipCodeRef"
|
|
|
+ v-if="equipTypeCode == '300'"
|
|
|
+ v-model="params.projectName"
|
|
|
+ title="工程名称:"
|
|
|
+ type="projectName"
|
|
|
+ :text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ placeholder="请输入工程名称"
|
|
|
+ />
|
|
|
+ <InputCom
|
|
|
+ v-if="equipTypeCode == '200'"
|
|
|
+ v-model="params.equipCode"
|
|
|
title="设备注册代码:"
|
|
|
type="equipCode"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
placeholder="请输入设备注册代码"
|
|
|
- @change="handleChange('equipCode', $event)"
|
|
|
/>
|
|
|
<InputCom
|
|
|
- ref="productNoRef"
|
|
|
+ v-if="equipTypeCode == '300'"
|
|
|
+ v-model="params.projectNo"
|
|
|
+ title="工程号:"
|
|
|
+ type="projectNo"
|
|
|
+ :text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ placeholder="请输入工程号"
|
|
|
+ />
|
|
|
+ <InputCom
|
|
|
+ v-model="params.factoryCode"
|
|
|
+ v-if="equipTypeCode == '200'"
|
|
|
title="出厂编号:"
|
|
|
- type="productNo"
|
|
|
+ type="factoryCode"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
placeholder="请输入出厂编号"
|
|
|
- @change="handleChange('productNo', $event)"
|
|
|
/>
|
|
|
<InputCom
|
|
|
- ref="unitNameRef"
|
|
|
+ v-model="params.unitName"
|
|
|
+ v-if="['200', '300'].includes(equipTypeCode)"
|
|
|
title="使用单位:"
|
|
|
type="unitName"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
placeholder="请输入使用单位"
|
|
|
- @change="handleChange('unitName', $event)"
|
|
|
/>
|
|
|
<InputCom
|
|
|
- ref="unitInnerNoRef"
|
|
|
+ v-model="params.unitInternalCode"
|
|
|
+ v-if="equipTypeCode == '200'"
|
|
|
title="单位内编号:"
|
|
|
- type="unitInnerNo"
|
|
|
+ type="unitInternalCode"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
placeholder="请输入单位内编号"
|
|
|
- @change="handleChange('unitInnerNo', $event)"
|
|
|
/>
|
|
|
<InputCom
|
|
|
- ref="useRegisterNoRef"
|
|
|
+ v-model="params.useRegisterNo"
|
|
|
+ v-if="['200', '300'].includes(equipTypeCode)"
|
|
|
title="使用证编号:"
|
|
|
type="useRegisterNo"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
placeholder="请输入使用证编号"
|
|
|
- @change="handleChange('useRegisterNo', $event)"
|
|
|
/>
|
|
|
<view class="form-actions">
|
|
|
<button class="action-btn reset-btn" @click.stop="handleReset">重置</button>
|
|
|
@@ -77,30 +96,38 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, computed } from 'vue'
|
|
|
import { InputCom } from '@/components/QueryViewItem'
|
|
|
-import { EquipTypeCom } from '@/components/QueryViewItem'
|
|
|
+import RadioFilterBar from '@/components/RadioFilterBar/RadioFilterBar.vue'
|
|
|
import iconMap from '@/utils/imagesMap'
|
|
|
|
|
|
+const props = defineProps<{
|
|
|
+ equipTypeCode: any;
|
|
|
+}>()
|
|
|
+
|
|
|
const emit = defineEmits<{
|
|
|
queryAction: [params: Record<string, any>]
|
|
|
- resetAction: []
|
|
|
+ resetAction: [],
|
|
|
+ 'update:equipTypeCode': [val: any]
|
|
|
}>()
|
|
|
|
|
|
const isOpen = ref(true)
|
|
|
const params = reactive({
|
|
|
- type: '',
|
|
|
- equipName: '',
|
|
|
- equipCode: '',
|
|
|
- productNo: '',
|
|
|
- unitName: '',
|
|
|
- unitInnerNo: '',
|
|
|
- useRegisterNo: '',
|
|
|
+ equipName: '',
|
|
|
+ projectName: '',
|
|
|
+
|
|
|
+ equipCode: '',
|
|
|
+ projectNo: '',
|
|
|
+
|
|
|
+ factoryCode: '',
|
|
|
+ unitName: '',
|
|
|
+ unitInternalCode: '',
|
|
|
+
|
|
|
+ useRegisterNo: '',
|
|
|
+ certificateNo: '',
|
|
|
})
|
|
|
|
|
|
const equipmentTypes = [
|
|
|
- { label: '全部', value: '' },
|
|
|
- { label: '压力容器', value: '1' },
|
|
|
- { label: '锅炉', value: '2' },
|
|
|
- { label: '管道', value: '3' },
|
|
|
+ { id: '200', value: '锅炉' },
|
|
|
+ { id: '300', value: '管道' },
|
|
|
]
|
|
|
|
|
|
const contentStyle = computed(() => ({
|
|
|
@@ -111,43 +138,31 @@ const contentStyle = computed(() => ({
|
|
|
transition: 'all 0.5s',
|
|
|
}))
|
|
|
|
|
|
-const equipTypeRef = ref<any>(null)
|
|
|
-const equipNameRef = ref<any>(null)
|
|
|
-const equipCodeRef = ref<any>(null)
|
|
|
-const productNoRef = ref<any>(null)
|
|
|
-const unitNameRef = ref<any>(null)
|
|
|
-const unitInnerNoRef = ref<any>(null)
|
|
|
-const useRegisterNoRef = ref<any>(null)
|
|
|
+const equipTypeCodeModel = computed({
|
|
|
+ get: () => props.equipTypeCode,
|
|
|
+ set: (val) => emit('update:equipTypeCode', val),
|
|
|
+})
|
|
|
|
|
|
const toggleFilter = () => {
|
|
|
isOpen.value = !isOpen.value
|
|
|
}
|
|
|
|
|
|
-const handleEquipTypeChange = (value: string | number) => {
|
|
|
- params.type = value as string
|
|
|
-}
|
|
|
+const handleReset = () => {
|
|
|
+ Object.assign(params, {
|
|
|
+ equipName: '',
|
|
|
+ projectName: '',
|
|
|
|
|
|
-const handleChange = (propName: string, value: string) => {
|
|
|
- params[propName as keyof typeof params] = value
|
|
|
-}
|
|
|
+ equipCode: '',
|
|
|
+ projectNo: '',
|
|
|
|
|
|
-const handleReset = () => {
|
|
|
- params.type = ''
|
|
|
- params.equipName = ''
|
|
|
- params.equipCode = ''
|
|
|
- params.productNo = ''
|
|
|
- params.unitName = ''
|
|
|
- params.unitInnerNo = ''
|
|
|
- params.useRegisterNo = ''
|
|
|
-
|
|
|
- equipTypeRef.value?.reset()
|
|
|
- equipNameRef.value?.reset()
|
|
|
- equipCodeRef.value?.reset()
|
|
|
- productNoRef.value?.reset()
|
|
|
- unitNameRef.value?.reset()
|
|
|
- unitInnerNoRef.value?.reset()
|
|
|
- useRegisterNoRef.value?.reset()
|
|
|
+ factoryCode: '',
|
|
|
+ unitName: '',
|
|
|
+ unitInternalCode: '',
|
|
|
|
|
|
+ useRegisterNo: '',
|
|
|
+ certificateNo: '',
|
|
|
+ })
|
|
|
+ emit('update:equipTypeCode', null)
|
|
|
emit('resetAction')
|
|
|
}
|
|
|
|
|
|
@@ -157,6 +172,7 @@ const handleQuery = () => {
|
|
|
|
|
|
defineExpose({
|
|
|
refresh: () => handleQuery(),
|
|
|
+ getParams: () => ({ ...params, certificateNo: params.useRegisterNo }),
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
@@ -223,4 +239,24 @@ defineExpose({
|
|
|
.arrow-rotate {
|
|
|
transform: rotate(180deg);
|
|
|
}
|
|
|
+
|
|
|
+.equip-type-row {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.equip-type-label {
|
|
|
+ color: rgb(51, 51, 51);
|
|
|
+ font-size: 14px;
|
|
|
+ text-align: right;
|
|
|
+ flex-shrink: 0;
|
|
|
+}
|
|
|
+
|
|
|
+.equip-type-radio {
|
|
|
+ flex: 1;
|
|
|
+ padding: 0;
|
|
|
+ border-bottom: none;
|
|
|
+}
|
|
|
</style>
|