| | |
| | | import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import {delWarning, getWarning, handleWarning} from "@/api/hazardousChemicals/warning"; |
| | | import {unWarningCount} from "@/api/hazardousChemicals/count"; |
| | | const { proxy } = getCurrentInstance(); |
| | | const loading = ref(false); |
| | | const dialogRef = ref(); |
| | |
| | | const classHourRef = ref(); |
| | | onMounted(()=>{ |
| | | getList() |
| | | getUnCount() |
| | | }) |
| | | |
| | | onUnmounted(()=>{ |
| | |
| | | if(res.code == 200){ |
| | | data.dataList = res.data.list |
| | | data.total = res.data.total |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | loading.value = false |
| | | } |
| | | const getUnCount = async () => { |
| | | const res = await unWarningCount() |
| | | if(res.code == 200){ |
| | | data.untreatedTotal = res.data |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | | |
| | | } |
| | | |
| | | const openDialog = (type, value) => { |
| | |
| | | state: null |
| | | } |
| | | getList() |
| | | getUnCount() |
| | | } |
| | | const handleDelete = (val) => { |
| | | ElMessageBox.confirm( |
| | |
| | | if(res.code == 200){ |
| | | ElMessage.success('数据删除成功') |
| | | await getList() |
| | | await getUnCount() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | const res = await handleWarning(val.id) |
| | | console.log("val",val) |
| | | const param = { |
| | | id: val.id, |
| | | state: 1, |
| | | companyId: val.companyId, |
| | | } |
| | | const res = await handleWarning(param) |
| | | if(res.code == 200){ |
| | | ElMessage.success('处理成功') |
| | | await getList() |
| | | await getUnCount() |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |