| | |
| | | </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" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180" > |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="viewFlow(scope.row)">取用记录</el-button> |
| | | <el-button link type="danger" v-if="scope.row.state === 0 || scope.row.state === 1|| scope.row.state === 2" @click="disCard(scope.row)">标签作废</el-button> |
| | | <el-button link type="primary" @click="viewQR(scope.row)">查看二维码</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | @pagination="getList" |
| | | /> |
| | | <viewQRcode ref="dialogRef" @getList="getList"></viewQRcode> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | width="650px" |
| | | :before-close="handleClose" |
| | | :close-on-press-escape="false" |
| | | :close-on-click-modal="false" |
| | | > |
| | | <flow-deail ref="flowRef"></flow-deail> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {nextTick, onMounted, reactive, ref} from "vue"; |
| | | import {useRoute, useRouter} from "vue-router"; |
| | | import flowDeail from '../../../components/flowDetail.vue' |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {disCardRaw, getRawDetail, getWhRawDetail} from "@/api/hazardousChemicals/rawRecord"; |
| | | import viewQRcode from '@/views/hazardousChemicals/electronicWarehouse/components/viewQR.vue' |
| | |
| | | const handleClose = () => { |
| | | dialogVisible.value = false |
| | | } |
| | | const disCard = async (val) => { |
| | | ElMessageBox.confirm( |
| | | '确定作废该标签?', |
| | | '提示', |
| | | { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await disCardRaw(val.id) |
| | | if(res.code == 200){ |
| | | ElMessage.success('操作成功') |
| | | await getList() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | }) |
| | | |
| | | |
| | | } |
| | | const viewFlow = (val) => { |
| | | dialogVisible.value = true |
| | | nextTick(() => { |
| | | flowRef.value.openDialog('raw',val) |
| | | }) |
| | | } |
| | | |
| | | 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"> |