|
@@ -1,8 +1,8 @@
|
|
|
<script setup>
|
|
|
import { CirclePlus } from '@element-plus/icons-vue'
|
|
|
import { ElMessageBox } from 'element-plus'
|
|
|
-import { getWorkFlowList, getAllWaterFactoryList, getPositionList, getAssayList, putWorkFlow, postWorkFlow, delWorkFlow } from '@/api/configuration'
|
|
|
-import { getAllDeviceList} from '@/api/client/manage'
|
|
|
+import { getWorkFlowList, getPositionList, getAssayList, putWorkFlow, postWorkFlow, delWorkFlow } from '@/api/configuration'
|
|
|
+import { getAllDeviceList, getAllWaterFactoryList} from '@/api/client/manage'
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
@@ -17,6 +17,7 @@ const tableData = ref([]);
|
|
|
|
|
|
const waterFactoryOptions = ref([]);
|
|
|
const deviceOptions = ref([]);
|
|
|
+const deviceSelectOptions = ref([]);
|
|
|
const pointOptions = ref([]);
|
|
|
const assayOptions = ref([]);
|
|
|
|
|
@@ -40,6 +41,11 @@ const rules = {
|
|
|
}, trigger: 'blur'}
|
|
|
}
|
|
|
|
|
|
+// 设备 - list - Search
|
|
|
+const initDeviceSearchOptions = (deviceWorks = '') => {
|
|
|
+ getAllDeviceList({ deviceWorks }).then(({ data }) => deviceSelectOptions.value = data)
|
|
|
+}
|
|
|
+
|
|
|
// 设备 - list
|
|
|
const initDeviceOptions = (deviceWorks) => {
|
|
|
deviceOptions.value = [];
|
|
@@ -73,6 +79,11 @@ const initPageData = async () => {
|
|
|
loading.value = false;
|
|
|
}
|
|
|
|
|
|
+// 水厂名称
|
|
|
+const onWaterFactorySearchChange = (deviceWorks) => {
|
|
|
+ queryParams.value.deviceId = ''
|
|
|
+ initDeviceSearchOptions(deviceWorks);
|
|
|
+}
|
|
|
|
|
|
// 查询
|
|
|
const handleQuery = async() => {
|
|
@@ -85,6 +96,7 @@ const handleReset = () => {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10
|
|
|
}
|
|
|
+ initDeviceSearchOptions();
|
|
|
initPageData();
|
|
|
}
|
|
|
|
|
@@ -212,7 +224,10 @@ const onDeviceSelectChange = (deviceId) => {
|
|
|
|
|
|
onMounted(async () => {
|
|
|
// 水厂
|
|
|
- getAllWaterFactoryList().then(({ data }) => waterFactoryOptions.value = data)
|
|
|
+ getAllWaterFactoryList().then(({ data }) => {
|
|
|
+ waterFactoryOptions.value = data
|
|
|
+ })
|
|
|
+ initDeviceSearchOptions()
|
|
|
// 化验项目
|
|
|
getAssayList({ pageNum: 1, pageSize: 9999 }).then(({ rows }) => assayOptions.value = rows)
|
|
|
// 初始化数据
|
|
@@ -231,7 +246,7 @@ onMounted(async () => {
|
|
|
<el-row class="pt-[5px]" justify="space-between" :gutter="20">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="水厂名称">
|
|
|
- <el-select v-model="queryParams.organizationId" placeholder="请选择水厂名称" filterable clearable>
|
|
|
+ <el-select v-model="queryParams.organizationId" placeholder="请选择水厂名称" filterable clearable @change="onWaterFactorySearchChange">
|
|
|
<el-option v-for="item in waterFactoryOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -239,7 +254,7 @@ onMounted(async () => {
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="设备SN / 名称">
|
|
|
<el-select v-model="queryParams.deviceId" placeholder="请选择设备SN" filterable clearable>
|
|
|
- <el-option v-for="item in deviceOptions" :key="item.deviceId" :label="(item.deviceSn ? item.deviceSn + '-' : '') + item.deviceName || ''" :value="item.deviceId" />
|
|
|
+ <el-option v-for="item in deviceSelectOptions" :key="item.deviceId" :label="(item.deviceSn ? item.deviceSn + '-' : '') + item.deviceName || ''" :value="item.deviceId" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -342,7 +357,6 @@ onMounted(async () => {
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
- {{ formData.itemId }}
|
|
|
<el-select v-model="formData.itemId" placeholder="请选择化验项目" filterable clearable>
|
|
|
<el-option v-for="item in assayOptions" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
</el-select>
|