| | |
| | | </div> |
| | | </div> |
| | | <!-- 表格数据 --> |
| | | <el-table v-loading="loading" :data="data.dataList" :border="true"> |
| | | <el-table v-loading="loading" :data="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" /> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="在库余量" prop="remaining" align="center" > |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.state === 0 || scope.row.state === 1">{{scope.row.remaining}}{{scope.row.hazmatBasic.unit}}</span> |
| | | <span v-else>—</span> |
| | | <span>{{scope.row.remaining}}{{scope.row.hazmatBasic.unit}}</span> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="所在仓库" prop="warehouseName" align="center" /> |
| | |
| | | }) |
| | | } |
| | | |
| | | const cellStyle = ({ row, column,rowIndex, columnIndex }) => { |
| | | let arr = [] |
| | | if (data.dataList !== null) { |
| | | data.dataList.filter((item, index) => { |
| | | arr.push(item.basicId) |
| | | }) |
| | | } |
| | | for (let i = 0; i <= arr.length; i++) { |
| | | if (arr[i] == row.basicId) { |
| | | if(row.remaining < row.hazmatBasic.metering){ |
| | | if (columnIndex === 11 || columnIndex === 10){ |
| | | return { color:' red' } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |