From 817f8b5f25e08499e7e90b38c002e74131d57c17 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期五, 18 四月 2025 14:30:12 +0800
Subject: [PATCH] 修改

---
 src/views/hazardousChemicals/basicInfon/index.vue |   94 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 71 insertions(+), 23 deletions(-)

diff --git a/src/views/hazardousChemicals/basicInfon/index.vue b/src/views/hazardousChemicals/basicInfon/index.vue
index 580be0c..94277a5 100644
--- a/src/views/hazardousChemicals/basicInfon/index.vue
+++ b/src/views/hazardousChemicals/basicInfon/index.vue
@@ -1,23 +1,43 @@
 <template>
   <div class="app-container">
     <div style="display: flex;flex-direction: column">
-      <div style="display: flex">
-        <el-button
-            type="primary"
-            plain
-            icon="Plus"
-            style="width: 70px;margin-bottom: 10px"
-            @click="openDialog('add',{})"
-        >新增</el-button>
-        <el-button
-            type="primary"
-            plain
-            style="width: 80px;margin-bottom: 10px"
-            @click="exportData"
-        >批量导入</el-button>
-      </div>
+<!--      <div style="display: flex">-->
+<!--        <el-button-->
+<!--            type="primary"-->
+<!--            plain-->
+<!--            icon="Plus"-->
+<!--            style="width: 70px;margin-bottom: 10px"-->
+<!--            @click="openDialog('add',{})"-->
+<!--        >新增</el-button>-->
+<!--        <el-button-->
+<!--            type="primary"-->
+<!--            plain-->
+<!--            style="width: 80px;margin-bottom: 10px"-->
+<!--            @click="exportData"-->
+<!--        >批量导入</el-button>-->
+<!--      </div>-->
 
       <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
+        <el-form-item label="企业名称:" >
+          <el-select
+              clearable
+              v-model="data.queryParams.companyId"
+              filterable
+              remote
+              reserve-keyword
+              placeholder="请输入企业名称"
+              remote-show-suffix
+              :remote-method="getCompanyList"
+              style="width: 100%"
+          >
+            <el-option
+                v-for="item in data.companyList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="名称:" >
           <el-input v-model="data.queryParams.name" placeholder="请输入危化品名称"></el-input>
         </el-form-item>
@@ -100,12 +120,12 @@
       <el-table-column label="安全库存" prop="safeNum" align="center"/>
       <el-table-column label="超期阈值(小时)" prop="threshold" align="center"/>
       <el-table-column label="单次入库最大数量" prop="maxEntry" align="center"/>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" >
-        <template #default="scope">
-          <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>
-          <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
-        </template>
-      </el-table-column>
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" >-->
+<!--        <template #default="scope">-->
+<!--          <el-button link type="primary" @click="openDialog('edit',scope.row)">编辑</el-button>-->
+<!--          <el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
     </el-table>
 
     <pagination
@@ -179,10 +199,12 @@
     cas:'',
     supplier: '',
     kind: '',
-    productSn: ''
+    productSn: '',
+    companyId: null
   },
   total: 0,
   dataList: [],
+  companyList: [],
   typeList: [
     {
       id: 0,
@@ -212,6 +234,7 @@
 const { queryParams, total, dataList } = toRefs(data);
 const classHourRef = ref();
 onMounted(()=>{
+  getCompanyList('')
   getList()
 })
 
@@ -231,6 +254,30 @@
   loading.value = false
 }
 
+const getCompanyList = async (val)=>{
+  if(val){
+    const queryParams = {
+      name: val
+    }
+    const res = await getCompany(queryParams)
+    if (res.code == 200) {
+      data.companyList = res.data.list
+    } else {
+      ElMessage.warning(res.message)
+    }
+  }else {
+    const queryParams = {
+      pageNum: 1,
+      pageSize: 10
+    }
+    const res = await getCompany(queryParams)
+    if (res.code == 200) {
+      data.companyList = res.data.list
+    } else {
+      ElMessage.warning(res.message)
+    }
+  }
+}
 const openDialog = (type, value) => {
   dialogRef.value.openDialog(type, value);
 }
@@ -244,7 +291,8 @@
     cas:'',
     supplier: '',
     kind: '',
-    productSn: ''
+    productSn: '',
+    companyId: null
   }
   getList()
 }

--
Gitblit v1.9.2