| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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(); |
| | |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | companyId: null, |
| | | params :{ |
| | | name: '', |
| | | productSn: '', |
| | | cupboardId: null, |
| | | warehouseId: null |
| | | warehouseId: null, |
| | | |
| | | } |
| | | }, |
| | | total: 0, |
| | | dataList: [], |
| | | wareHouseList: [], |
| | | cupList: [] |
| | | cupList: [], |
| | | companyList: [] |
| | | |
| | | }); |
| | | |
| | |
| | | onMounted(()=>{ |
| | | getList() |
| | | getWareHouseList("") |
| | | getCompanyList("") |
| | | }) |
| | | |
| | | const getList = async () => { |
| | | const getList = async (type) => { |
| | | loading.value = true |
| | | const res = await getRawRecord(data.queryParams) |
| | | if(res.code == 200){ |
| | |
| | | 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); |
| | | } |
| | |
| | | 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( |