| | |
| | | </el-form> |
| | | </div> |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="dataList" :border="true"> |
| | | <el-table v-loading="loading" :data="dataList" :border="true" :cell-style="cellStyle"> |
| | | <el-table-column label="序号" type="index" align="center" width="80" /> |
| | | <el-table-column label="品名" prop="hazmatBasic.name" align="center" /> |
| | | <el-table-column label="产品编号" prop="hazmatBasic.productSn" align="center" /> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="批号" prop="batchNo" align="center" width="120" /> |
| | | <el-table-column label="当前库存" prop="stock" align="center" width="120" /> |
| | | <el-table-column label="不完整归还" prop="missStock" align="center" width="120" /> |
| | | <el-table-column label="安全库存" prop="hazmatBasic.safeNum" align="center" width="120" /> |
| | | <el-table-column label="所在仓库" prop="warehouseName" align="center" > |
| | | <template #default="scope"> |
| | | <span>{{scope.row.warehouse.name}}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" prop="state" align="center"> |
| | | <template #default="scope"> |
| | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | import rawWarehouseDialog from './rawWarehouseRecord.vue' |
| | | import {delRawRecord, doEntryRaw, getRawRecord, getRawWarehouseRecord} from "@/api/hazardousChemicals/rawRecord"; |
| | | import { |
| | | delRawRecord, |
| | | doEntryRaw, |
| | | getRawList, |
| | | getRawRecord, |
| | | getRawWarehouseRecord |
| | | } from "@/api/hazardousChemicals/rawRecord"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | |
| | | dataList: [] |
| | | }); |
| | | |
| | | const selectValue = ref([]) |
| | | const { queryParams, total, dataList } = toRefs(data); |
| | | const classHourRef = ref(); |
| | | onMounted(()=>{ |
| | |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | const res = await getRawRecord(data.queryParams) |
| | | const res = await getRawList(data.queryParams) |
| | | if(res.code == 200){ |
| | | data.dataList = res.data.list |
| | | data.dataList.forEach(item => { |
| | | if(item.stock+item.missStock < item.hazmatBasic.safeNum){ |
| | | selectValue.value.push(item) |
| | | } |
| | | }) |
| | | data.total = res.data.total |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | |
| | | dialogRef.value.openDialog(val) |
| | | } |
| | | |
| | | const cellStyle = ({ row, column,rowIndex, columnIndex }) => { |
| | | let arr = [] |
| | | if (selectValue.value !== null) { |
| | | selectValue.value.filter((item, index) => { |
| | | arr.push(item.basicId) |
| | | }) |
| | | } |
| | | for (var i = 0; i <= arr.length; i++) { |
| | | if (arr[i] == row.basicId) { |
| | | if (columnIndex === 9 || columnIndex === 10 || columnIndex === 11){ |
| | | return { backgroundColor: '#FFD7CC !important',color:' red' } |
| | | } |
| | | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | defineExpose({ |
| | | getList |
| | | }); |