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/warehouseManage/components/rawTable.vue | 83 ++++++++++++++++++++++++++++++++++------- 1 files changed, 68 insertions(+), 15 deletions(-) diff --git a/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue b/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue index 348c595..88ee725 100644 --- a/src/views/hazardousChemicals/warehouseManage/components/rawTable.vue +++ b/src/views/hazardousChemicals/warehouseManage/components/rawTable.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> @@ -98,10 +118,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> @@ -127,6 +147,7 @@ import {delRawRecord, doEntryRaw, getRawRecord, getRawWarehouseRecord} from "@/api/hazardousChemicals/rawRecord"; import {useRoute, useRouter} from "vue-router"; import {getCupById, getWarehouse} from "@/api/hazardousChemicals/warehouse"; +import {getCompany} from "@/api/hazardousChemicals/company"; const { proxy } = getCurrentInstance(); const loading = ref(false); const dialogRef = ref(); @@ -137,17 +158,20 @@ queryParams: { pageNum: 1, pageSize: 10, + companyId: null, params :{ name: '', productSn: '', cupboardId: null, - warehouseId: null + warehouseId: null, + } }, total: 0, dataList: [], wareHouseList: [], - cupList: [] + cupList: [], + companyList: [] }); @@ -156,9 +180,10 @@ onMounted(()=>{ getList() getWareHouseList("") + getCompanyList("") }) -const getList = async () => { +const getList = async (type) => { loading.value = true const res = await getRawRecord(data.queryParams) if(res.code == 200){ @@ -170,6 +195,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); } @@ -179,16 +228,20 @@ 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( -- Gitblit v1.9.2