From 3eaa7e28218b227bda647f2da21e6d9317832eef Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 15 九月 2025 15:08:15 +0800
Subject: [PATCH] 库存预警修改
---
src/views/warehouseManagement/KeyCoalLocks/index.vue | 492 +++++++++++++++++++++++++-----------------------------
1 files changed, 230 insertions(+), 262 deletions(-)
diff --git a/src/views/warehouseManagement/KeyCoalLocks/index.vue b/src/views/warehouseManagement/KeyCoalLocks/index.vue
index 45f77b4..adcd73d 100644
--- a/src/views/warehouseManagement/KeyCoalLocks/index.vue
+++ b/src/views/warehouseManagement/KeyCoalLocks/index.vue
@@ -3,23 +3,23 @@
<!-- 鎼滅储琛ㄥ崟 -->
<div class="search_form">
<el-form :model="searchForm" :inline="true">
- <el-form-item label="鍌ㄦ皵缃愬悕绉帮細">
- <el-input v-model="searchForm.tankName" placeholder="璇疯緭鍏ュ偍姘旂綈鍚嶇О" clearable style="width: 200px" />
+ <el-form-item label="鐓や粨鍚嶇О锛�">
+ <el-input v-model="searchForm.coalBinName" placeholder="璇疯緭鍏ョ叅浠撳悕绉�" clearable style="width: 200px" />
</el-form-item>
- <el-form-item label="鍌ㄦ皵缃愮被鍨嬶細">
- <el-select v-model="searchForm.tankType" placeholder="璇烽�夋嫨鍌ㄦ皵缃愮被鍨�" clearable style="width: 200px">
- <el-option label="娑插寲姘斿偍缃�" value="娑插寲姘斿偍缃�" />
- <el-option label="鍘嬬缉姘斿偍缃�" value="鍘嬬缉姘斿偍缃�" />
- <el-option label="澶╃劧姘斿偍缃�" value="澶╃劧姘斿偍缃�" />
- <el-option label="姘ф皵鍌ㄧ綈" value="姘ф皵鍌ㄧ綈" />
+ <el-form-item label="鐓ょ偔绫诲瀷锛�">
+ <el-select v-model="searchForm.coalType" placeholder="璇烽�夋嫨鐓ょ偔绫诲瀷" clearable style="width: 200px">
+ <el-option label="鏃犵儫鐓�" value="鏃犵儫鐓�" />
+ <el-option label="鐑熺叅" value="鐑熺叅" />
+ <el-option label="瑜愮叅" value="瑜愮叅" />
+ <el-option label="鐒︾叅" value="鐒︾叅" />
</el-select>
</el-form-item>
<el-form-item label="棰勮绫诲瀷锛�">
<el-select v-model="searchForm.warningType" placeholder="璇烽�夋嫨棰勮绫诲瀷" clearable style="width: 200px">
- <el-option label="姘斾綋涓嶈冻" value="姘斾綋涓嶈冻" />
- <el-option label="鍘嬪姏寮傚父" value="鍘嬪姏寮傚父" />
+ <el-option label="搴撳瓨涓嶈冻" value="搴撳瓨涓嶈冻" />
+ <el-option label="璐ㄩ噺寮傚父" value="璐ㄩ噺寮傚父" />
<el-option label="娓╁害寮傚父" value="娓╁害寮傚父" />
- <el-option label="娉勬紡棰勮" value="娉勬紡棰勮" />
+ <el-option label="鑷噧棰勮" value="鑷噧棰勮" />
</el-select>
</el-form-item>
<el-form-item label="棰勮绾у埆锛�">
@@ -40,7 +40,7 @@
<div class="table_list">
<!-- 鎿嶄綔鎸夐挳 -->
<div class="table-operations">
- <el-button type="primary" @click="handleAdd">鏂板棰勮瑙勫垯</el-button>
+ <el-button type="primary" @click="handleAdd">鏂板鐓ょ偔棰勮瑙勫垯</el-button>
<el-button type="success" @click="handleBatchProcess">鎵归噺澶勭悊</el-button>
<el-button @click="handleExport">瀵煎嚭</el-button>
</div>
@@ -56,22 +56,22 @@
<el-table-column align="center" label="搴忓彿" type="index" width="60" />
<!-- 鍩虹淇℃伅瀛楁 -->
- <el-table-column label="鍌ㄦ皵缃愮紪鐮�" prop="tankCode" width="120" show-overflow-tooltip />
- <el-table-column label="鍌ㄦ皵缃愬悕绉�" prop="tankName" width="200" show-overflow-tooltip />
- <el-table-column label="鍌ㄦ皵缃愮被鍨�" prop="tankType" width="120" show-overflow-tooltip />
- <el-table-column label="瑙勬牸鍨嬪彿" prop="specificationModel" width="150" show-overflow-tooltip />
- <el-table-column label="瀹圭Н(m鲁)" prop="volume" width="100" show-overflow-tooltip />
+ <el-table-column label="鐓や粨缂栫爜" prop="coalBinCode" width="120" show-overflow-tooltip />
+ <el-table-column label="鐓や粨鍚嶇О" prop="coalBinName" width="200" show-overflow-tooltip />
+ <el-table-column label="鐓ょ偔绫诲瀷" prop="coalType" width="120" show-overflow-tooltip />
+ <el-table-column label="鐓よ川绛夌骇" prop="coalGrade" width="150" show-overflow-tooltip />
+ <el-table-column label="瀹归噺(鍚�)" prop="capacity" width="100" show-overflow-tooltip />
<!-- 搴撳瓨鐩稿叧瀛楁 -->
- <el-table-column label="褰撳墠姘斾綋閲�" prop="currentGasLevel" width="120" show-overflow-tooltip>
+ <el-table-column label="褰撳墠搴撳瓨閲�" prop="currentStock" width="120" show-overflow-tooltip>
<template #default="scope">
- <span :class="getGasLevelClass(scope.row)">{{ scope.row.currentGasLevel }}%</span>
+ <span :class="getStockLevelClass(scope.row)">{{ scope.row.currentStock }}鍚�</span>
</template>
</el-table-column>
- <el-table-column label="瀹夊叏姘斾綋閲�" prop="safetyGasLevel" width="120" show-overflow-tooltip />
- <el-table-column label="鏈�浣庢皵浣撻噺" prop="minGasLevel" width="120" show-overflow-tooltip />
- <el-table-column label="鏈�楂樻皵浣撻噺" prop="maxGasLevel" width="120" show-overflow-tooltip />
- <el-table-column label="褰撳墠鍘嬪姏(MPa)" prop="currentPressure" width="140" show-overflow-tooltip />
+ <el-table-column label="瀹夊叏搴撳瓨閲�" prop="safetyStock" width="120" show-overflow-tooltip />
+ <el-table-column label="鏈�浣庡簱瀛橀噺" prop="minStock" width="120" show-overflow-tooltip />
+ <el-table-column label="鏈�楂樺簱瀛橀噺" prop="maxStock" width="120" show-overflow-tooltip />
+ <el-table-column label="褰撳墠娓╁害(掳C)" prop="currentTemperature" width="140" show-overflow-tooltip />
<!-- 棰勮瑙勫垯瀛楁 -->
<el-table-column label="棰勮绫诲瀷" prop="warningType" width="100" show-overflow-tooltip>
@@ -99,12 +99,12 @@
<el-table-column label="棰勮鏃堕棿" prop="warningTime" width="150" show-overflow-tooltip />
<el-table-column label="棰勮鎸佺画澶╂暟" prop="warningDuration" width="120" show-overflow-tooltip />
<el-table-column label="鏈�鍚庢洿鏂版椂闂�" prop="lastUpdateTime" width="150" show-overflow-tooltip />
- <el-table-column label="棰勮鍏呰鏃堕棿" prop="expectedRefillTime" width="150" show-overflow-tooltip />
- <el-table-column label="棰勮缂烘皵鏃堕棿" prop="expectedShortageTime" width="150" show-overflow-tooltip>
+ <el-table-column label="棰勮琛ョ叅鏃堕棿" prop="expectedRefillTime" width="150" show-overflow-tooltip />
+ <el-table-column label="棰勮缂虹叅鏃堕棿" prop="expectedShortageTime" width="150" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.expectedShortageTime">
<div v-if="getCountdown(scope.row.expectedShortageTime).isExpired" class="countdown-expired">
- <el-tag type="danger">宸茬己姘�</el-tag>
+ <el-tag type="danger">宸茬己鐓�</el-tag>
</div>
<div v-else class="countdown-timer">
<span :class="getCountdownClass(scope.row.expectedShortageTime)">
@@ -140,7 +140,7 @@
<!-- 鏂板/缂栬緫棰勮瑙勫垯寮圭獥 -->
<el-dialog
v-model="dialogFormVisible"
- :title="operationType === 'add' ? '鏂板棰勮瑙勫垯' : '缂栬緫棰勮瑙勫垯'"
+ :title="operationType === 'add' ? '鏂板鐓ょ偔棰勮瑙勫垯' : '缂栬緫鐓ょ偔棰勮瑙勫垯'"
width="50%"
@close="closeDialog"
>
@@ -148,44 +148,44 @@
<el-row :gutter="20">
<!-- 鍩虹淇℃伅 -->
<el-col :span="12">
- <el-form-item label="鍌ㄦ皵缃愮紪鐮侊細" prop="tankCode">
- <el-input v-model="form.tankCode" placeholder="璇疯緭鍏ュ偍姘旂綈缂栫爜" />
+ <el-form-item label="鐓や粨缂栫爜锛�" prop="coalBinCode">
+ <el-input v-model="form.coalBinCode" placeholder="璇疯緭鍏ョ叅浠撶紪鐮�" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鍌ㄦ皵缃愬悕绉帮細" prop="tankName">
- <el-input v-model="form.tankName" placeholder="璇疯緭鍏ュ偍姘旂綈鍚嶇О" />
+ <el-form-item label="鐓や粨鍚嶇О锛�" prop="coalBinName">
+ <el-input v-model="form.coalBinName" placeholder="璇疯緭鍏ョ叅浠撳悕绉�" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="鍌ㄦ皵缃愮被鍨嬶細" prop="tankType">
- <el-select v-model="form.tankType" placeholder="璇烽�夋嫨鍌ㄦ皵缃愮被鍨�" style="width: 100%">
- <el-option label="娑插寲姘斿偍缃�" value="娑插寲姘斿偍缃�" />
- <el-option label="鍘嬬缉姘斿偍缃�" value="鍘嬬缉姘斿偍缃�" />
- <el-option label="澶╃劧姘斿偍缃�" value="澶╃劧姘斿偍缃�" />
- <el-option label="姘ф皵鍌ㄧ綈" value="姘ф皵鍌ㄧ綈" />
+ <el-form-item label="鐓ょ偔绫诲瀷锛�" prop="coalType">
+ <el-select v-model="form.coalType" placeholder="璇烽�夋嫨鐓ょ偔绫诲瀷" style="width: 100%">
+ <el-option label="鏃犵儫鐓�" value="鏃犵儫鐓�" />
+ <el-option label="鐑熺叅" value="鐑熺叅" />
+ <el-option label="瑜愮叅" value="瑜愮叅" />
+ <el-option label="鐒︾叅" value="鐒︾叅" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="瑙勬牸鍨嬪彿锛�" prop="specificationModel">
- <el-input v-model="form.specificationModel" placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" />
+ <el-form-item label="鐓よ川绛夌骇锛�" prop="coalGrade">
+ <el-input v-model="form.coalGrade" placeholder="璇疯緭鍏ョ叅璐ㄧ瓑绾�" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="瀹圭Н(m鲁)锛�" prop="volume">
- <el-input-number v-model="form.volume" :min="0" :precision="2" style="width: 100%" />
+ <el-form-item label="瀹归噺(鍚�)锛�" prop="capacity">
+ <el-input-number v-model="form.capacity" :min="0" :precision="2" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="褰撳墠姘斾綋閲�(%)锛�" prop="currentGasLevel">
- <el-input-number v-model="form.currentGasLevel" :min="0" :max="100" :precision="1" style="width: 100%" />
+ <el-form-item label="褰撳墠搴撳瓨閲�(鍚�)锛�" prop="currentStock">
+ <el-input-number v-model="form.currentStock" :min="0" :precision="1" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
@@ -193,26 +193,26 @@
<!-- 搴撳瓨鐩稿叧 -->
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="瀹夊叏姘斾綋閲�(%)锛�" prop="safetyGasLevel">
- <el-input-number v-model="form.safetyGasLevel" :min="0" :max="100" :precision="1" style="width: 100%" />
+ <el-form-item label="瀹夊叏搴撳瓨閲�(鍚�)锛�" prop="safetyStock">
+ <el-input-number v-model="form.safetyStock" :min="0" :precision="1" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鏈�浣庢皵浣撻噺(%)锛�" prop="minGasLevel">
- <el-input-number v-model="form.minGasLevel" :min="0" :max="100" :precision="1" style="width: 100%" />
+ <el-form-item label="鏈�浣庡簱瀛橀噺(鍚�)锛�" prop="minStock">
+ <el-input-number v-model="form.minStock" :min="0" :precision="1" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="鏈�楂樻皵浣撻噺(%)锛�" prop="maxGasLevel">
- <el-input-number v-model="form.maxGasLevel" :min="0" :max="100" :precision="1" style="width: 100%" />
+ <el-form-item label="鏈�楂樺簱瀛橀噺(鍚�)锛�" prop="maxStock">
+ <el-input-number v-model="form.maxStock" :min="0" :precision="1" style="width: 100%" />
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="褰撳墠鍘嬪姏(MPa)锛�" prop="currentPressure">
- <el-input-number v-model="form.currentPressure" :min="0" :precision="2" style="width: 100%" />
+ <el-form-item label="褰撳墠娓╁害(掳C)锛�" prop="currentTemperature">
+ <el-input-number v-model="form.currentTemperature" :min="0" :precision="2" style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
@@ -222,10 +222,10 @@
<el-col :span="12">
<el-form-item label="棰勮绫诲瀷锛�" prop="warningType">
<el-select v-model="form.warningType" placeholder="璇烽�夋嫨棰勮绫诲瀷" style="width: 100%">
- <el-option label="姘斾綋涓嶈冻" value="姘斾綋涓嶈冻" />
- <el-option label="鍘嬪姏寮傚父" value="鍘嬪姏寮傚父" />
+ <el-option label="搴撳瓨涓嶈冻" value="搴撳瓨涓嶈冻" />
+ <el-option label="璐ㄩ噺寮傚父" value="璐ㄩ噺寮傚父" />
<el-option label="娓╁害寮傚父" value="娓╁害寮傚父" />
- <el-option label="娉勬紡棰勮" value="娉勬紡棰勮" />
+ <el-option label="鑷噧棰勮" value="鑷噧棰勮" />
</el-select>
</el-form-item>
</el-col>
@@ -267,11 +267,11 @@
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="棰勮鍏呰鏃堕棿锛�" prop="expectedRefillTime">
+ <el-form-item label="棰勮琛ョ叅鏃堕棿锛�" prop="expectedRefillTime">
<el-date-picker
v-model="form.expectedRefillTime"
type="datetime"
- placeholder="璇烽�夋嫨棰勮鍏呰鏃堕棿"
+ placeholder="璇烽�夋嫨棰勮琛ョ叅鏃堕棿"
style="width: 100%"
value-format="YYYY-MM-DD HH:mm:ss"
/>
@@ -281,11 +281,11 @@
<el-row :gutter="20">
<el-col :span="12">
- <el-form-item label="棰勮缂烘皵鏃堕棿锛�" prop="expectedShortageTime">
+ <el-form-item label="棰勮缂虹叅鏃堕棿锛�" prop="expectedShortageTime">
<el-date-picker
v-model="form.expectedShortageTime"
type="datetime"
- placeholder="璇烽�夋嫨棰勮缂烘皵鏃堕棿"
+ placeholder="璇烽�夋嫨棰勮缂虹叅鏃堕棿"
style="width: 100%"
value-format="YYYY-MM-DD HH:mm:ss"
/>
@@ -312,10 +312,10 @@
</template>
</el-dialog>
- <!-- 缂烘皵棰勮寮规 -->
+ <!-- 缂虹叅棰勮寮规 -->
<el-dialog
v-model="shortageWarningVisible"
- title="鈿狅笍 缂烘皵棰勮"
+ title="鈿狅笍 缂虹叅棰勮"
width="400px"
:close-on-click-modal="false"
:close-on-press-escape="false"
@@ -326,43 +326,12 @@
<el-icon size="48" color="#f56c6c"><WarningFilled /></el-icon>
</div>
<div class="warning-message">
- <h3>{{ currentWarningTank.tankName }}</h3>
- <p>鍌ㄦ皵缃愬凡缂烘皵锛岃鍙婃椂澶勭悊锛�</p>
+ <h3>{{ currentWarningTank.coalBinName }}</h3>
+ <p>鐓や粨宸茬己鐓わ紝璇峰強鏃跺鐞嗭紒</p>
<p class="warning-details">
- 鍌ㄦ皵缃愮紪鐮侊細{{ currentWarningTank.tankCode }}<br>
- 鍌ㄦ皵缃愮被鍨嬶細{{ currentWarningTank.tankType }}<br>
- 褰撳墠姘斾綋閲忥細{{ currentWarningTank.currentGasLevel }}%
- </p>
- </div>
- </div>
- <template #footer>
- <div class="dialog-footer">
- <el-button type="primary" @click="handleShortageWarning">绔嬪嵆澶勭悊</el-button>
- <el-button @click="closeShortageWarning">绋嶅悗澶勭悊</el-button>
- </div>
- </template>
- </el-dialog>
-
- <!-- 缂烘皵棰勮寮规 -->
- <el-dialog
- v-model="shortageWarningVisible"
- title="鈿狅笍 缂烘皵棰勮"
- width="400px"
- :close-on-click-modal="false"
- :close-on-press-escape="false"
- :show-close="false"
- >
- <div class="shortage-warning-content">
- <div class="warning-icon">
- <el-icon size="48" color="#f56c6c"><WarningFilled /></el-icon>
- </div>
- <div class="warning-message">
- <h3>{{ currentWarningTank.tankName }}</h3>
- <p>鍌ㄦ皵缃愬凡缂烘皵锛岃鍙婃椂澶勭悊锛�</p>
- <p class="warning-details">
- 鍌ㄦ皵缃愮紪鐮侊細{{ currentWarningTank.tankCode }}<br>
- 鍌ㄦ皵缃愮被鍨嬶細{{ currentWarningTank.tankType }}<br>
- 褰撳墠姘斾綋閲忥細{{ currentWarningTank.currentGasLevel }}%
+ 鐓や粨缂栫爜锛歿{ currentWarningTank.coalBinCode }}<br>
+ 鐓ょ偔绫诲瀷锛歿{ currentWarningTank.coalType }}<br>
+ 褰撳墠搴撳瓨閲忥細{{ currentWarningTank.currentStock }}鍚�
</p>
</div>
</div>
@@ -402,7 +371,7 @@
const operationType = ref('add')
const total = ref(0)
-// 缂烘皵棰勮鐩稿叧
+// 缂虹叅棰勮鐩稿叧
const shortageWarningVisible = ref(false)
const currentWarningTank = ref({})
const countdownTimer = ref(null)
@@ -415,8 +384,8 @@
// 鎼滅储琛ㄥ崟
const searchForm = reactive({
- tankName: '',
- tankType: '',
+ coalBinName: '',
+ coalType: '',
warningType: '',
warningLevel: ''
})
@@ -424,16 +393,16 @@
// 琛ㄥ崟鏁版嵁
const form = reactive({
id: null,
- tankCode: '',
- tankName: '',
- tankType: '',
- specificationModel: '',
- volume: 0,
- currentGasLevel: 0,
- safetyGasLevel: 0,
- minGasLevel: 0,
- maxGasLevel: 0,
- currentPressure: 0,
+ coalBinCode: '',
+ coalBinName: '',
+ coalType: '',
+ coalGrade: '',
+ capacity: 0,
+ currentStock: 0,
+ safetyStock: 0,
+ minStock: 0,
+ maxStock: 0,
+ currentTemperature: 0,
warningType: '',
warningLevel: '',
warningThreshold: 0,
@@ -448,9 +417,9 @@
// 琛ㄥ崟楠岃瘉瑙勫垯
const rules = {
- tankCode: [{ required: true, message: '璇疯緭鍏ュ偍姘旂綈缂栫爜', trigger: 'blur' }],
- tankName: [{ required: true, message: '璇疯緭鍏ュ偍姘旂綈鍚嶇О', trigger: 'blur' }],
- tankType: [{ required: true, message: '璇烽�夋嫨鍌ㄦ皵缃愮被鍨�', trigger: 'change' }],
+ coalBinCode: [{ required: true, message: '璇疯緭鍏ョ叅浠撶紪鐮�', trigger: 'blur' }],
+ coalBinName: [{ required: true, message: '璇疯緭鍏ョ叅浠撳悕绉�', trigger: 'blur' }],
+ coalType: [{ required: true, message: '璇烽�夋嫨鐓ょ偔绫诲瀷', trigger: 'change' }],
warningType: [{ required: true, message: '璇烽�夋嫨棰勮绫诲瀷', trigger: 'change' }],
warningLevel: [{ required: true, message: '璇烽�夋嫨棰勮绾у埆', trigger: 'change' }],
warningThreshold: [{ required: true, message: '璇疯緭鍏ラ璀﹂槇鍊�', trigger: 'blur' }]
@@ -465,7 +434,7 @@
const diff = expected - now
if (diff <= 0) {
- return { text: '宸茬己姘�', isExpired: true }
+ return { text: '宸茬己鐓�', isExpired: true }
}
const days = Math.floor(diff / (1000 * 60 * 60 * 24))
@@ -500,23 +469,23 @@
}
}
-// 妫�鏌ョ己姘旈璀�
+// 妫�鏌ョ己鐓ら璀�
const checkShortageWarnings = () => {
- tableData.value.forEach(tank => {
- if (tank.expectedShortageTime) {
- const countdown = getCountdown(tank.expectedShortageTime)
- if (countdown.isExpired && !tank.warningShown) {
+ tableData.value.forEach(coalBin => {
+ if (coalBin.expectedShortageTime) {
+ const countdown = getCountdown(coalBin.expectedShortageTime)
+ if (countdown.isExpired && !coalBin.warningShown) {
// 鏍囪宸叉樉绀洪璀︼紝閬垮厤閲嶅寮规
- tank.warningShown = true
- showShortageWarning(tank)
+ coalBin.warningShown = true
+ showShortageWarning(coalBin)
}
}
})
}
-// 鏄剧ず缂烘皵棰勮寮规
-const showShortageWarning = (tank) => {
- currentWarningTank.value = tank
+// 鏄剧ず缂虹叅棰勮寮规
+const showShortageWarning = (coalBin) => {
+ currentWarningTank.value = coalBin
shortageWarningVisible.value = true
// 鎾斁鎻愮ず闊筹紙鍙�夛級
@@ -524,15 +493,14 @@
// audio.play()
}
-// 澶勭悊缂烘皵棰勮
+// 澶勭悊缂虹叅棰勮
const handleShortageWarning = () => {
- ElMessage.success(`姝e湪澶勭悊鍌ㄦ皵缃� ${currentWarningTank.value.tankName} 鐨勭己姘旈棶棰榒)
+ ElMessage.success(`姝e湪澶勭悊鐓や粨 ${currentWarningTank.value.coalBinName} 鐨勭己鐓ら棶棰榒)
shortageWarningVisible.value = false
// 杩欓噷鍙互璋冪敤澶勭悊API
}
-// 澶勭悊缂烘皵棰勮
+// 鍏抽棴缂虹叅棰勮
const closeShortageWarning = () => {
- // ElMessage.success(`姝e湪澶勭悊鍌ㄦ皵缃� ${currentWarningTank.value.tankName} 鐨勭己姘旈棶棰榒)
shortageWarningVisible.value = false
// 杩欓噷鍙互璋冪敤澶勭悊API
}
@@ -544,194 +512,194 @@
const mockData = [
{
id: 1,
- tankCode: 'TANK001',
- tankName: '娑插寲姘斿偍缃怉',
- tankType: '娑插寲姘斿偍缃�',
- specificationModel: 'LPG-5000L',
- volume: 5000,
- currentGasLevel: 15,
- safetyGasLevel: 30,
- minGasLevel: 10,
- maxGasLevel: 95,
- currentPressure: 2.5,
- warningType: '姘斾綋涓嶈冻',
+ coalBinCode: 'COAL001',
+ coalBinName: '鏃犵儫鐓や粨A',
+ coalType: '鏃犵儫鐓�',
+ coalGrade: '浼樿川鐓�',
+ capacity: 5000,
+ currentStock: 750,
+ safetyStock: 1500,
+ minStock: 500,
+ maxStock: 4750,
+ currentTemperature: 45,
+ warningType: '搴撳瓨涓嶈冻',
warningLevel: '绱ф��',
- warningThreshold: 20,
+ warningThreshold: 1000,
isEnabled: true,
warningTime: '2024-01-15 08:30:00',
warningDuration: 3,
lastUpdateTime: '2024-01-15 10:00:00',
expectedRefillTime: '2024-01-16 14:00:00',
- expectedShortageTime: '2024-01-15 18:30:00', // 浠婂ぉ涓嬪崍6:30缂烘皵
- warningRule: '褰撴皵浣撻噺浣庝簬20%鏃惰Е鍙戦璀�'
+ expectedShortageTime: '2024-01-15 18:30:00', // 浠婂ぉ涓嬪崍6:30缂虹叅
+ warningRule: '褰撳簱瀛橀噺浣庝簬1000鍚ㄦ椂瑙﹀彂棰勮'
},
{
id: 2,
- tankCode: 'TANK002',
- tankName: '鍘嬬缉姘斿偍缃怋',
- tankType: '鍘嬬缉姘斿偍缃�',
- specificationModel: 'COMP-3000L',
- volume: 3000,
- currentGasLevel: 45,
- safetyGasLevel: 25,
- minGasLevel: 15,
- maxGasLevel: 90,
- currentPressure: 8.2,
- warningType: '鍘嬪姏寮傚父',
+ coalBinCode: 'COAL002',
+ coalBinName: '鐑熺叅浠揃',
+ coalType: '鐑熺叅',
+ coalGrade: '涓瓑鐓�',
+ capacity: 3000,
+ currentStock: 1350,
+ safetyStock: 750,
+ minStock: 450,
+ maxStock: 2700,
+ currentTemperature: 52,
+ warningType: '璐ㄩ噺寮傚父',
warningLevel: '閲嶈',
- warningThreshold: 10,
+ warningThreshold: 800,
isEnabled: true,
warningTime: '2024-01-14 16:20:00',
warningDuration: 2,
lastUpdateTime: '2024-01-15 09:15:00',
expectedRefillTime: '2024-01-17 09:00:00',
- expectedShortageTime: '2024-01-18 12:00:00', // 3澶╁悗缂烘皵
- warningRule: '褰撳帇鍔涜秴杩�8MPa鏃惰Е鍙戦璀�'
+ expectedShortageTime: '2024-01-18 12:00:00', // 3澶╁悗缂虹叅
+ warningRule: '褰撶叅璐ㄦ寚鏍囧紓甯告椂瑙﹀彂棰勮'
},
{
id: 3,
- tankCode: 'TANK003',
- tankName: '澶╃劧姘斿偍缃怌',
- tankType: '澶╃劧姘斿偍缃�',
- specificationModel: 'NG-8000L',
- volume: 8000,
- currentGasLevel: 75,
- safetyGasLevel: 20,
- minGasLevel: 10,
- maxGasLevel: 95,
- currentPressure: 4.8,
+ coalBinCode: 'COAL003',
+ coalBinName: '瑜愮叅浠揅',
+ coalType: '瑜愮叅',
+ coalGrade: '鏅�氱叅',
+ capacity: 8000,
+ currentStock: 6000,
+ safetyStock: 1600,
+ minStock: 800,
+ maxStock: 7600,
+ currentTemperature: 38,
warningType: '娓╁害寮傚父',
warningLevel: '涓�鑸�',
- warningThreshold: 5,
+ warningThreshold: 1800,
isEnabled: true,
warningTime: '2024-01-13 11:45:00',
warningDuration: 1,
lastUpdateTime: '2024-01-15 08:45:00',
expectedRefillTime: '2024-01-20 10:00:00',
- expectedShortageTime: '2024-01-22 15:30:00', // 7澶╁悗缂烘皵
+ expectedShortageTime: '2024-01-22 15:30:00', // 7澶╁悗缂虹叅
warningRule: '褰撴俯搴﹁秴杩�60掳C鏃惰Е鍙戦璀�'
},
{
id: 4,
- tankCode: 'TANK004',
- tankName: '姘ф皵鍌ㄧ綈D',
- tankType: '姘ф皵鍌ㄧ綈',
- specificationModel: 'O2-2000L',
- volume: 2000,
- currentGasLevel: 8,
- safetyGasLevel: 25,
- minGasLevel: 5,
- maxGasLevel: 90,
- currentPressure: 6.5,
- warningType: '娉勬紡棰勮',
+ coalBinCode: 'COAL004',
+ coalBinName: '鐒︾叅浠揇',
+ coalType: '鐒︾叅',
+ coalGrade: '鐗圭骇鐓�',
+ capacity: 2000,
+ currentStock: 160,
+ safetyStock: 500,
+ minStock: 100,
+ maxStock: 1800,
+ currentTemperature: 68,
+ warningType: '鑷噧棰勮',
warningLevel: '绱ф��',
- warningThreshold: 15,
+ warningThreshold: 300,
isEnabled: true,
warningTime: '2024-01-15 07:15:00',
warningDuration: 4,
lastUpdateTime: '2024-01-15 11:30:00',
expectedRefillTime: '2024-01-15 16:00:00',
- expectedShortageTime: '2024-01-15 14:00:00', // 浠婂ぉ涓嬪崍2鐐圭己姘�
- warningRule: '褰撴娴嬪埌姘斾綋娉勬紡鏃惰Е鍙戦璀�'
+ expectedShortageTime: '2024-01-15 14:00:00', // 浠婂ぉ涓嬪崍2鐐圭己鐓�
+ warningRule: '褰撴娴嬪埌鑷噧椋庨櫓鏃惰Е鍙戦璀�'
},
{
id: 5,
- tankCode: 'TANK005',
- tankName: '娑插寲姘斿偍缃怑',
- tankType: '娑插寲姘斿偍缃�',
- specificationModel: 'LPG-6000L',
- volume: 6000,
- currentGasLevel: 35,
- safetyGasLevel: 30,
- minGasLevel: 15,
- maxGasLevel: 95,
- currentPressure: 3.2,
- warningType: '姘斾綋涓嶈冻',
+ coalBinCode: 'COAL005',
+ coalBinName: '鏃犵儫鐓や粨E',
+ coalType: '鏃犵儫鐓�',
+ coalGrade: '浼樿川鐓�',
+ capacity: 6000,
+ currentStock: 2100,
+ safetyStock: 1800,
+ minStock: 900,
+ maxStock: 5700,
+ currentTemperature: 42,
+ warningType: '搴撳瓨涓嶈冻',
warningLevel: '閲嶈',
- warningThreshold: 20,
+ warningThreshold: 1200,
isEnabled: false,
warningTime: '2024-01-14 14:30:00',
warningDuration: 2,
lastUpdateTime: '2024-01-15 09:00:00',
expectedRefillTime: '2024-01-19 08:00:00',
- expectedShortageTime: '2024-01-21 10:00:00', // 6澶╁悗缂烘皵
- warningRule: '褰撴皵浣撻噺浣庝簬20%鏃惰Е鍙戦璀�'
+ expectedShortageTime: '2024-01-21 10:00:00', // 6澶╁悗缂虹叅
+ warningRule: '褰撳簱瀛橀噺浣庝簬1200鍚ㄦ椂瑙﹀彂棰勮'
},
{
id: 6,
- tankCode: 'TANK006',
- tankName: '鍘嬬缉姘斿偍缃怓',
- tankType: '鍘嬬缉姘斿偍缃�',
- specificationModel: 'COMP-4000L',
- volume: 4000,
- currentGasLevel: 85,
- safetyGasLevel: 20,
- minGasLevel: 10,
- maxGasLevel: 90,
- currentPressure: 7.8,
- warningType: '鍘嬪姏寮傚父',
+ coalBinCode: 'COAL006',
+ coalBinName: '鐑熺叅浠揊',
+ coalType: '鐑熺叅',
+ coalGrade: '涓瓑鐓�',
+ capacity: 4000,
+ currentStock: 3400,
+ safetyStock: 800,
+ minStock: 400,
+ maxStock: 3600,
+ currentTemperature: 48,
+ warningType: '璐ㄩ噺寮傚父',
warningLevel: '涓�鑸�',
- warningThreshold: 8,
+ warningThreshold: 900,
isEnabled: true,
warningTime: '2024-01-12 09:20:00',
warningDuration: 1,
lastUpdateTime: '2024-01-15 08:30:00',
expectedRefillTime: '2024-01-25 14:00:00',
- expectedShortageTime: '2024-01-28 16:00:00', // 13澶╁悗缂烘皵
- warningRule: '褰撳帇鍔涜秴杩�8MPa鏃惰Е鍙戦璀�'
+ expectedShortageTime: '2024-01-28 16:00:00', // 13澶╁悗缂虹叅
+ warningRule: '褰撶叅璐ㄦ寚鏍囧紓甯告椂瑙﹀彂棰勮'
},
{
id: 7,
- tankCode: 'TANK007',
- tankName: '澶╃劧姘斿偍缃怗',
- tankType: '澶╃劧姘斿偍缃�',
- specificationModel: 'NG-10000L',
- volume: 10000,
- currentGasLevel: 92,
- safetyGasLevel: 15,
- minGasLevel: 8,
- maxGasLevel: 95,
- currentPressure: 5.2,
+ coalBinCode: 'COAL007',
+ coalBinName: '瑜愮叅浠揋',
+ coalType: '瑜愮叅',
+ coalGrade: '鏅�氱叅',
+ capacity: 10000,
+ currentStock: 9200,
+ safetyStock: 1500,
+ minStock: 800,
+ maxStock: 9500,
+ currentTemperature: 55,
warningType: '娓╁害寮傚父',
warningLevel: '閲嶈',
- warningThreshold: 6,
+ warningThreshold: 1600,
isEnabled: true,
warningTime: '2024-01-11 16:45:00',
warningDuration: 1,
lastUpdateTime: '2024-01-15 07:45:00',
expectedRefillTime: '2024-01-30 09:00:00',
- expectedShortageTime: '2024-02-05 12:00:00', // 21澶╁悗缂烘皵
+ expectedShortageTime: '2024-02-05 12:00:00', // 21澶╁悗缂虹叅
warningRule: '褰撴俯搴﹁秴杩�60掳C鏃惰Е鍙戦璀�'
},
{
id: 8,
- tankCode: 'TANK008',
- tankName: '姘ф皵鍌ㄧ綈H',
- tankType: '姘ф皵鍌ㄧ綈',
- specificationModel: 'O2-1500L',
- volume: 1500,
- currentGasLevel: 12,
- safetyGasLevel: 30,
- minGasLevel: 8,
- maxGasLevel: 90,
- currentPressure: 4.5,
- warningType: '娉勬紡棰勮',
+ coalBinCode: 'COAL008',
+ coalBinName: '鐒︾叅浠揌',
+ coalType: '鐒︾叅',
+ coalGrade: '鐗圭骇鐓�',
+ capacity: 1500,
+ currentStock: 180,
+ safetyStock: 450,
+ minStock: 120,
+ maxStock: 1350,
+ currentTemperature: 72,
+ warningType: '鑷噧棰勮',
warningLevel: '绱ф��',
- warningThreshold: 12,
+ warningThreshold: 250,
isEnabled: true,
warningTime: '2024-01-15 06:30:00',
warningDuration: 5,
lastUpdateTime: '2024-01-15 12:15:00',
expectedRefillTime: '2024-01-15 20:00:00',
- expectedShortageTime: '2024-01-15 17:30:00', // 浠婂ぉ涓嬪崍5:30缂烘皵
- warningRule: '褰撴娴嬪埌姘斾綋娉勬紡鏃惰Е鍙戦璀�'
+ expectedShortageTime: '2024-01-15 17:30:00', // 浠婂ぉ涓嬪崍5:30缂虹叅
+ warningRule: '褰撴娴嬪埌鑷噧椋庨櫓鏃惰Е鍙戦璀�'
}
]
// 鏍规嵁鎼滅储鏉′欢杩囨护鏁版嵁
let filteredData = mockData.filter(item => {
- if (searchForm.tankName && !item.tankName.includes(searchForm.tankName)) return false
- if (searchForm.tankType && item.tankType !== searchForm.tankType) return false
+ if (searchForm.coalBinName && !item.coalBinName.includes(searchForm.coalBinName)) return false
+ if (searchForm.coalType && item.coalType !== searchForm.coalType) return false
if (searchForm.warningType && item.warningType !== searchForm.warningType) return false
if (searchForm.warningLevel && item.warningLevel !== searchForm.warningLevel) return false
return true
@@ -814,7 +782,7 @@
try {
// 妯℃嫙API璋冪敤寤惰繜
await new Promise(resolve => setTimeout(resolve, 300))
- ElMessage.success(`姝e湪澶勭悊棰勮锛�${row.tankName}`)
+ ElMessage.success(`姝e湪澶勭悊棰勮锛�${row.coalBinName}`)
getList()
} catch (error) {
ElMessage.error('澶勭悊棰勮澶辫触')
@@ -824,7 +792,7 @@
// 鍒犻櫎
const handleDelete = async (row) => {
try {
- await ElMessageBox.confirm(`纭畾瑕佸垹闄ら璀﹁鍒欙細${row.tankName}鍚楋紵`, '鎻愮ず', {
+ await ElMessageBox.confirm(`纭畾瑕佸垹闄ら璀﹁鍒欙細${row.coalBinName}鍚楋紵`, '鎻愮ず', {
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning'
@@ -873,7 +841,7 @@
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
- link.download = `鍌ㄦ皵缃愰璀︽暟鎹甠${new Date().getTime()}.csv`
+ link.download = `鐓ょ偔搴撳瓨棰勮鏁版嵁_${new Date().getTime()}.csv`
link.click()
window.URL.revokeObjectURL(url)
@@ -886,26 +854,26 @@
// 鐢熸垚CSV鍐呭
const generateCSV = (data) => {
const headers = [
- '鍌ㄦ皵缃愮紪鐮�', '鍌ㄦ皵缃愬悕绉�', '鍌ㄦ皵缃愮被鍨�', '瑙勬牸鍨嬪彿', '瀹圭Н(m鲁)',
- '褰撳墠姘斾綋閲�(%)', '瀹夊叏姘斾綋閲�(%)', '鏈�浣庢皵浣撻噺(%)', '鏈�楂樻皵浣撻噺(%)',
- '褰撳墠鍘嬪姏(MPa)', '棰勮绫诲瀷', '棰勮绾у埆', '棰勮闃堝��', '鏄惁鍚敤',
- '棰勮鏃堕棿', '棰勮鎸佺画澶╂暟', '鏈�鍚庢洿鏂版椂闂�', '棰勮鍏呰鏃堕棿', '棰勮缂烘皵鏃堕棿', '棰勮瑙勫垯鎻忚堪'
+ '鐓や粨缂栫爜', '鐓や粨鍚嶇О', '鐓ょ偔绫诲瀷', '鐓よ川绛夌骇', '瀹归噺(鍚�)',
+ '褰撳墠搴撳瓨閲�(鍚�)', '瀹夊叏搴撳瓨閲�(鍚�)', '鏈�浣庡簱瀛橀噺(鍚�)', '鏈�楂樺簱瀛橀噺(鍚�)',
+ '褰撳墠娓╁害(掳C)', '棰勮绫诲瀷', '棰勮绾у埆', '棰勮闃堝��', '鏄惁鍚敤',
+ '棰勮鏃堕棿', '棰勮鎸佺画澶╂暟', '鏈�鍚庢洿鏂版椂闂�', '棰勮琛ョ叅鏃堕棿', '棰勮缂虹叅鏃堕棿', '棰勮瑙勫垯鎻忚堪'
]
const csvRows = [headers.join(',')]
data.forEach(item => {
const row = [
- item.tankCode,
- item.tankName,
- item.tankType,
- item.specificationModel,
- item.volume,
- item.currentGasLevel,
- item.safetyGasLevel,
- item.minGasLevel,
- item.maxGasLevel,
- item.currentPressure,
+ item.coalBinCode,
+ item.coalBinName,
+ item.coalType,
+ item.coalGrade,
+ item.capacity,
+ item.currentStock,
+ item.safetyStock,
+ item.minStock,
+ item.maxStock,
+ item.currentTemperature,
item.warningType,
item.warningLevel,
item.warningThreshold,
@@ -928,7 +896,7 @@
try {
// 妯℃嫙API璋冪敤寤惰繜
await new Promise(resolve => setTimeout(resolve, 200))
- ElMessage.success(`${row.tankName} 鐨勫惎鐢ㄧ姸鎬佸凡鏇存柊`)
+ ElMessage.success(`${row.coalBinName} 鐨勫惎鐢ㄧ姸鎬佸凡鏇存柊`)
} catch (error) {
ElMessage.error('鐘舵�佹洿鏂板け璐�')
// 鎭㈠鍘熺姸鎬�
@@ -979,11 +947,11 @@
proxy.$refs.formRef?.resetFields()
}
-// 鑾峰彇姘斾綋閲忔牱寮忕被
-const getGasLevelClass = (row) => {
- if (row.currentGasLevel < row.minGasLevel) {
+// 鑾峰彇搴撳瓨閲忔牱寮忕被
+const getStockLevelClass = (row) => {
+ if (row.currentStock < row.minStock) {
return 'text-danger'
- } else if (row.currentGasLevel > row.maxGasLevel) {
+ } else if (row.currentStock > row.maxStock) {
return 'text-warning'
}
return 'text-success'
@@ -992,10 +960,10 @@
// 鑾峰彇棰勮绫诲瀷鏍囩鏍峰紡
const getWarningTypeTag = (type) => {
const typeMap = {
- '姘斾綋涓嶈冻': 'danger',
- '鍘嬪姏寮傚父': 'warning',
+ '搴撳瓨涓嶈冻': 'danger',
+ '璐ㄩ噺寮傚父': 'warning',
'娓╁害寮傚父': 'info',
- '娉勬紡棰勮': 'danger'
+ '鑷噧棰勮': 'danger'
}
return typeMap[type] || 'info'
}
--
Gitblit v1.9.3