From 817f8b5f25e08499e7e90b38c002e74131d57c17 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: Fri, 18 Apr 2025 14:30:12 +0800
Subject: [PATCH] 修改
---
src/views/hazardousChemicals/warehouseManage/components/productTable.vue | 82 ++++++++++++++++++++++++++++++++++-------
1 files changed, 68 insertions(+), 14 deletions(-)
diff --git a/src/views/hazardousChemicals/warehouseManage/components/productTable.vue b/src/views/hazardousChemicals/warehouseManage/components/productTable.vue
index c6854c4..dae62b6 100644
--- a/src/views/hazardousChemicals/warehouseManage/components/productTable.vue
+++ b/src/views/hazardousChemicals/warehouseManage/components/productTable.vue
@@ -2,13 +2,33 @@
<div class="app-container">
<div style="display: flex;justify-content: space-between">
<el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
- <el-form-item>
- <el-button
- type="primary"
- plain
- icon="Plus"
- @click="openDialog('add',{})"
- >新增</el-button>
+<!-- <el-form-item>-->
+<!-- <el-button-->
+<!-- type="primary"-->
+<!-- plain-->
+<!-- icon="Plus"-->
+<!-- @click="openDialog('add',{})"-->
+<!-- >新增</el-button>-->
+<!-- </el-form-item>-->
+ <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.params.name" placeholder="请输入品名" clearable></el-input>
@@ -96,10 +116,10 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" >
<template #default="scope">
<el-button link type="primary" v-if="scope.row.state == 1" @click="toDetail(scope.row)">查看详情</el-button>
- <el-button link type="primary" v-if="scope.row.state == 0" @click="doEntry(scope.row)">入库</el-button>
- <el-button link type="primary" v-if="scope.row.state == 1" @click="printCode(scope.row)">打印二维码</el-button>
- <el-button link type="primary" @click="openDialog('edit',scope.row)" v-if="scope.row.state == 0">编辑</el-button>
- <el-button link type="danger" @click="handleDelete(scope.row)" v-if="scope.row.state == 0">删除</el-button>
+<!-- <el-button link type="primary" v-if="scope.row.state == 0" @click="doEntry(scope.row)">入库</el-button>-->
+<!-- <el-button link type="primary" v-if="scope.row.state == 1" @click="printCode(scope.row)">打印二维码</el-button>-->
+<!-- <el-button link type="primary" @click="openDialog('edit',scope.row)" v-if="scope.row.state == 0">编辑</el-button>-->
+<!-- <el-button link type="danger" @click="handleDelete(scope.row)" v-if="scope.row.state == 0">删除</el-button>-->
</template>
</el-table-column>
</el-table>
@@ -129,6 +149,7 @@
} from "@/api/hazardousChemicals/productRecord";
import {delRawRecord} from "@/api/hazardousChemicals/rawRecord";
import {useRoute, useRouter} from "vue-router";
+import {getCompany} from "@/api/hazardousChemicals/company";
const { proxy } = getCurrentInstance();
const loading = ref(false);
const dialogRef = ref();
@@ -139,17 +160,19 @@
queryParams: {
pageNum: 1,
pageSize: 10,
+ companyId: null,
params :{
name: '',
productSn: '',
cupboardId: null,
- warehouseId: null
+ warehouseId: null,
}
},
total: 0,
dataList: [],
wareHouseList: [],
- cupList: []
+ cupList: [],
+ companyList: []
});
const { queryParams, total, dataList } = toRefs(data);
@@ -157,6 +180,8 @@
onMounted(()=>{
getList()
getWareHouseList("")
+ getCompanyList("")
+
})
const getList = async () => {
@@ -174,22 +199,50 @@
const openDialog = (type, value) => {
dialogRef.value.openDialog(type, value);
}
+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)
+ }
+ }
+}
/** 重置新增的表单以及其他数据 */
function reset() {
data.queryParams = {
pageNum: 1,
pageSize: 10,
+ companyId: null,
params :{
name: '',
productSn: '',
cupboardId: null,
- warehouseId: null
+ warehouseId: null,
+
}
}
+ data.companyList = []
data.cupList = []
getList()
getWareHouseList("")
+ getCompanyList("")
}
const handleDelete = (val) => {
ElMessageBox.confirm(
@@ -239,6 +292,7 @@
pageNum: data.queryParams.pageNum,
pageSize: data.queryParams.pageSize,
entryId: val.id,
+ companyId: val.companyId
}
const v = JSON.stringify(obj)
router.push({ path: "/whProDetail", query: { val: v } });
--
Gitblit v1.9.2