|
|
@@ -1,52 +1,45 @@
|
|
|
<template>
|
|
|
<view class="query-view">
|
|
|
- <view class="query-content" :style="contentStyle">
|
|
|
- <view class="query-left">
|
|
|
- <InputCom
|
|
|
- ref="orderNoRef"
|
|
|
- title="任务单号:"
|
|
|
- type="orderNo"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0 }"
|
|
|
- @change="handleChange('orderNo', $event)"
|
|
|
- />
|
|
|
- <CheckNatureCom
|
|
|
- ref="checkTypeRef"
|
|
|
- title="检验性质:"
|
|
|
- type="checkType"
|
|
|
- :equip-type="equipType"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0 }"
|
|
|
- @change="handleChange('checkType', $event)"
|
|
|
- />
|
|
|
- <CheckDateCom
|
|
|
- ref="checkDateRef"
|
|
|
- title="检验时间:"
|
|
|
- type="checkDate"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0 }"
|
|
|
- @change="handleChange('checkDate', $event)"
|
|
|
- />
|
|
|
- <CellCom
|
|
|
- ref="mainCheckerStrIdsRef"
|
|
|
- title="主检人:"
|
|
|
- type="mainCheckerStrIds"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0, marginBottom: 0 }"
|
|
|
- @click="showUserListPopup('主检人', 'mainCheckerStrIds')"
|
|
|
- />
|
|
|
- <CellCom
|
|
|
- ref="managerIdRef"
|
|
|
- title="项目负责人:"
|
|
|
- type="managerId"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0, marginBottom: 0 }"
|
|
|
- @click="showUserListPopup('项目负责人', 'managerId')"
|
|
|
- />
|
|
|
- </view>
|
|
|
+ <view :style="contentStyle">
|
|
|
+ <view class="query-content">
|
|
|
+ <view class="query-left">
|
|
|
+ <InputCom
|
|
|
+ ref="orderNoRef"
|
|
|
+ title="任务单号:"
|
|
|
+ type="orderNo"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ @change="handleChange('orderNo', $event)"
|
|
|
+ />
|
|
|
+ <CheckNatureCom
|
|
|
+ ref="checkTypeRef"
|
|
|
+ title="检验性质:"
|
|
|
+ type="checkType"
|
|
|
+ :equip-type="equipType"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ @change="handleChange('checkType', $event)"
|
|
|
+ />
|
|
|
+ <CheckDateCom
|
|
|
+ ref="checkDateRef"
|
|
|
+ title="检验时间:"
|
|
|
+ type="checkDate"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ @change="handleChange('checkDate', $event)"
|
|
|
+ />
|
|
|
+ <CellCom
|
|
|
+ ref="mainCheckerStrIdsRef"
|
|
|
+ title="主检人:"
|
|
|
+ type="mainCheckerStrIds"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0, marginBottom: 0 }"
|
|
|
+ @click="showUserListPopup('主检人', 'mainCheckerStrIds')"
|
|
|
+ />
|
|
|
+ </view>
|
|
|
|
|
|
- <view class="query-right">
|
|
|
- <CellCom
|
|
|
+ <view class="query-right">
|
|
|
+ <!-- <CellCom
|
|
|
ref="queryTypeRef"
|
|
|
:title="queryTypeTitle"
|
|
|
type="queryType"
|
|
|
@@ -54,57 +47,71 @@
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
:default-value="defaultValue"
|
|
|
@click="showUserListPopup(queryTypeTitle, 'queryType')"
|
|
|
- />
|
|
|
- <InputCom
|
|
|
- v-if="equipType === EquipmentType.BOILER || equipType === EquipmentType.CONTAINER"
|
|
|
- ref="equipCodeRef"
|
|
|
- title="设备注册代码:"
|
|
|
- type="equipCode"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0 }"
|
|
|
- @change="handleChange('equipCode', $event)"
|
|
|
- />
|
|
|
- <InputCom
|
|
|
- v-if="equipType === EquipmentType.PIPE"
|
|
|
- ref="projectNoRef"
|
|
|
- title="工程号:"
|
|
|
- type="projectNo"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0 }"
|
|
|
- @change="handleChange('projectNo', $event)"
|
|
|
- />
|
|
|
- <InputCom
|
|
|
- ref="unitNameRef"
|
|
|
- title="单位名称:"
|
|
|
- type="unitName"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :style="{ marginLeft: 0 }"
|
|
|
- @change="handleChange('unitName', $event)"
|
|
|
- />
|
|
|
- <CellCom
|
|
|
- ref="checkUserStrIdsRef"
|
|
|
- title="检验员:"
|
|
|
- type="checkUserStrIds"
|
|
|
- :text-style="{ width: '100px' }"
|
|
|
- :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>
|
|
|
+ /> -->
|
|
|
+ <InputCom
|
|
|
+ v-if="equipType === EquipmentType.BOILER || equipType === EquipmentType.CONTAINER"
|
|
|
+ ref="equipCodeRef"
|
|
|
+ title="设备注册代码:"
|
|
|
+ type="equipCode"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ @change="handleChange('equipCode', $event)"
|
|
|
+ />
|
|
|
+ <InputCom
|
|
|
+ v-if="equipType === EquipmentType.PIPE"
|
|
|
+ ref="projectNoRef"
|
|
|
+ title="工程号:"
|
|
|
+ type="projectNo"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ @change="handleChange('projectNo', $event)"
|
|
|
+ />
|
|
|
+ <InputCom
|
|
|
+ ref="unitNameRef"
|
|
|
+ title="单位名称:"
|
|
|
+ type="unitName"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ @change="handleChange('unitName', $event)"
|
|
|
+ />
|
|
|
+ <CellCom
|
|
|
+ ref="checkUserStrIdsRef"
|
|
|
+ title="检验员:"
|
|
|
+ type="checkUserStrIds"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0, marginBottom: 0 }"
|
|
|
+ @click="showUserListPopup('检验员', 'checkUserStrIds')"
|
|
|
+ />
|
|
|
+ <CellCom
|
|
|
+ ref="managerIdRef"
|
|
|
+ title="项目负责人:"
|
|
|
+ type="managerId"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0, marginBottom: 0 }"
|
|
|
+ @click="showUserListPopup('项目负责人', 'managerId')"
|
|
|
+ />
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="btn-group">
|
|
|
+ <button class="btn reset-btn" @click="reset">重置</button>
|
|
|
+ <button class="btn query-btn" @click="query">查询</button>
|
|
|
+ </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 }"
|
|
|
- />
|
|
|
+ <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': isOpen }" />
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 人员选择弹窗 -->
|
|
|
+ <SelectUserModal
|
|
|
+ v-model="userModalVisible"
|
|
|
+ :title="userModalTitle"
|
|
|
+ :selected="userModalSelected"
|
|
|
+ :multiple="userModalMultiple"
|
|
|
+ @confirm="handleUserConfirm"
|
|
|
+ @cancel="handleUserCancel"
|
|
|
+ />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -117,6 +124,7 @@ import { InputCom } from '@/components/QueryViewItem'
|
|
|
import { CheckDateCom } from '@/components/QueryViewItem'
|
|
|
import { CheckNatureCom } from '@/components/QueryViewItem'
|
|
|
import { CellCom } from '@/components/QueryViewItem'
|
|
|
+import { SelectUserModal } from '@/components/QueryViewItem'
|
|
|
|
|
|
interface Props {
|
|
|
equipType: EquipmentType
|
|
|
@@ -203,6 +211,13 @@ const reset = () => {
|
|
|
managerId: '',
|
|
|
})
|
|
|
|
|
|
+ // 清空人员选择缓存
|
|
|
+ userSelectedCache.value = {
|
|
|
+ mainCheckerStrIds: [],
|
|
|
+ checkUserStrIds: [],
|
|
|
+ managerId: [],
|
|
|
+ }
|
|
|
+
|
|
|
emit('queryAction', params)
|
|
|
}
|
|
|
|
|
|
@@ -216,7 +231,50 @@ const query = () => {
|
|
|
}
|
|
|
|
|
|
const showUserListPopup = (title: string, type: string) => {
|
|
|
- console.log('显示用户列表弹窗:', title, type)
|
|
|
+ userModalTitle.value = title
|
|
|
+ userModalType.value = type
|
|
|
+ userModalSelected.value = userSelectedCache.value[type] || []
|
|
|
+ // 主检人、项目负责人为单选,检验员为多选
|
|
|
+ userModalMultiple.value = type === 'checkUserStrIds'
|
|
|
+ userModalVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
+// 人员选择弹窗相关状态
|
|
|
+const userModalVisible = ref(false)
|
|
|
+const userModalTitle = ref('')
|
|
|
+const userModalType = ref('')
|
|
|
+const userModalSelected = ref<any[]>([])
|
|
|
+const userModalMultiple = ref(true)
|
|
|
+
|
|
|
+// 按字段类型缓存已选用户
|
|
|
+const userSelectedCache = ref<Record<string, any[]>>({
|
|
|
+ mainCheckerStrIds: [],
|
|
|
+ checkUserStrIds: [],
|
|
|
+ managerId: [],
|
|
|
+})
|
|
|
+
|
|
|
+const handleUserConfirm = (users: any[]) => {
|
|
|
+ const type = userModalType.value
|
|
|
+ const displayNames = users.map((u) => u.nickname || u.username || '').join(',')
|
|
|
+ const ids = users.map((u) => u.id).join(',')
|
|
|
+
|
|
|
+ // 缓存已选用户
|
|
|
+ userSelectedCache.value[type] = users
|
|
|
+
|
|
|
+ if (type === 'mainCheckerStrIds') {
|
|
|
+ mainCheckerStrIdsRef.value?.setInputContent(displayNames)
|
|
|
+ params.mainCheckerStrIds = ids
|
|
|
+ } else if (type === 'checkUserStrIds') {
|
|
|
+ checkUserStrIdsRef.value?.setInputContent(displayNames)
|
|
|
+ params.checkUserStrIds = ids
|
|
|
+ } else if (type === 'managerId') {
|
|
|
+ managerIdRef.value?.setInputContent(displayNames)
|
|
|
+ params.managerId = ids
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const handleUserCancel = () => {
|
|
|
+ // 取消不做额外处理
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
@@ -237,7 +295,7 @@ const showUserListPopup = (title: string, type: string) => {
|
|
|
.query-left,
|
|
|
.query-right {
|
|
|
flex: 1;
|
|
|
- padding: 15px 0;
|
|
|
+ padding: 15px 0 0 0;
|
|
|
}
|
|
|
|
|
|
.query-right {
|
|
|
@@ -248,14 +306,15 @@ const showUserListPopup = (title: string, type: string) => {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
justify-content: flex-end;
|
|
|
- margin-top: 10px;
|
|
|
padding: 0 10%;
|
|
|
gap: 10%;
|
|
|
+ margin: 0 20% 10px;
|
|
|
}
|
|
|
|
|
|
.btn {
|
|
|
padding: 0 15px;
|
|
|
height: 30px;
|
|
|
+ width: 40%;
|
|
|
margin-left: 5px;
|
|
|
border-radius: 3px;
|
|
|
display: flex;
|