xuzhancheng 5 дней назад
Родитель
Сommit
ba7778e2c4

+ 25 - 1
yudao-ui-admin-vue3/src/views/pressure2/equipboiler/EquipBoilerForm.vue

@@ -858,6 +858,7 @@
       }"
       @onPageNoChange="handleFetchUnitList"
       @onPageSizeChange="pageSizeChange"
+      @onSearch="handleUnitSearch"
     />
   </CustomDialog>
 </template>
@@ -1289,16 +1290,32 @@ const unitColumns = ref([
   {
     label: '单位代码',
     prop: 'code',
+    search: {
+      type: 'input',
+      span: 12,
+      prop: 'code',
+      label: '单位代码',
+      fieldProps: { placeholder: '请输入单位代码' }
+    }
   },
   {
     label: '单位名称',
     prop: 'name',
+    search: {
+      type: 'input',
+      span: 12,
+      prop: 'name',
+      label: '单位名称',
+      fieldProps: { placeholder: '请输入单位名称' }
+    }
   }
 ])
 const unitTableList = ref([])
 const unitPageNo = ref(1)
 const unitPageSize = ref(10)
 const unitTotal = ref(0)
+// 单位搜索条件
+const unitSearchParams = ref<{ code?: string; name?: string }>({})
 const handleUnitSelect = (selections, row) => {
   if(selections.length > 1) {
     ElMessage.warning(`最多可选择1个`)
@@ -1310,10 +1327,17 @@ const pageSizeChange = (value) => {
   unitPageSize.value = value
   handleFetchUnitList()
 }
-const handleFetchUnitList = async (value?) => {
+// 单位搜索
+const handleUnitSearch = (searchForm: any) => {
+  unitSearchParams.value = { ...searchForm }
+  unitPageNo.value = 1
+  handleFetchUnitList()
+}
+const handleFetchUnitList = async () => {
   const result = await getUnitList({
     pageNo: unitPageNo.value,
     pageSize: unitPageSize.value,
+    ...unitSearchParams.value,
   })
   unitTableList.value = result.list
   unitTotal.value = result.total

+ 25 - 0
yudao-ui-admin-vue3/src/views/pressure2/pipeequipment/PipeEquipmentForm.vue

@@ -408,6 +408,7 @@
       }"
       @onPageNoChange="handleFetchUnitList"
       @onPageSizeChange="pageSizeChange"
+      @onSearch="handleUnitSearch"
     />
   </CustomDialog>
 </template>
@@ -666,16 +667,32 @@ const unitColumns = ref([
   {
     label: '单位代码',
     prop: 'code',
+    search: {
+      type: 'input',
+      span: 12,
+      prop: 'code',
+      label: '单位代码',
+      fieldProps: { placeholder: '请输入单位代码' }
+    }
   },
   {
     label: '单位名称',
     prop: 'name',
+    search: {
+      type: 'input',
+      span: 12,
+      prop: 'name',
+      label: '单位名称',
+      fieldProps: { placeholder: '请输入单位名称' }
+    }
   }
 ])
 const unitTableList = ref([])
 const unitPageNo = ref(1)
 const unitPageSize = ref(10)
 const unitTotal = ref(0)
+// 单位搜索条件
+const unitSearchParams = ref<{ code?: string; name?: string }>({})
 const handleUnitSelect = (selections, row) => {
   if(selections.length > 1) {
     ElMessage.warning(`最多可选择1个`)
@@ -689,10 +706,18 @@ const pageSizeChange = (value) => {
   handleFetchUnitList()
 }
 
+// 单位搜索
+const handleUnitSearch = (searchForm: any) => {
+  unitSearchParams.value = { ...searchForm }
+  unitPageNo.value = 1
+  handleFetchUnitList()
+}
+
 const handleFetchUnitList = async () => {
   const result = await getUnitList({
     pageNo: unitPageNo.value,
     pageSize: unitPageSize.value,
+    ...unitSearchParams.value,
   })
   unitTableList.value = result.list
   unitTotal.value = result.total