From be125538c6e9c17a923c9dbe1e4cca9962b0ed39 Mon Sep 17 00:00:00 2001 From: yaowanxin <3588231647@qq.com> Date: 星期一, 08 九月 2025 10:17:53 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into ywx --- src/views/inventoryManagement/stockWarning/index.vue | 146 ++++++++++++++++++++++++------------------------ 1 files changed, 73 insertions(+), 73 deletions(-) diff --git a/src/views/inventoryManagement/stockWarning/index.vue b/src/views/inventoryManagement/stockWarning/index.vue index 880c29f..4f0b849 100644 --- a/src/views/inventoryManagement/stockWarning/index.vue +++ b/src/views/inventoryManagement/stockWarning/index.vue @@ -44,24 +44,24 @@ <!-- <el-button type="success" @click="handleBatchProcess">鎵归噺澶勭悊</el-button> --> <el-button @click="handleExport">瀵煎嚭</el-button> </div> - <el-table - :data="tableData" - border - v-loading="tableLoading" + <el-table + :data="tableData" + border + v-loading="tableLoading" @selection-change="handleSelectionChange" style="width: 100%" height="calc(100vh - 280px)" > <el-table-column align="center" type="selection" width="55" /> <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="currentGasLevel" width="120" show-overflow-tooltip> <template #default="scope"> @@ -72,7 +72,7 @@ <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="warningType" width="100" show-overflow-tooltip> <template #default="scope"> @@ -94,7 +94,7 @@ <el-switch v-model="scope.row.isEnabled" @change="handleEnableChange(scope.row)" /> </template> </el-table-column> - + <!-- 鏃堕棿鐩稿叧瀛楁 --> <el-table-column label="棰勮鏃堕棿" prop="warningTime" width="150" show-overflow-tooltip /> <el-table-column label="棰勮鎸佺画澶╂暟" prop="warningDuration" width="120" show-overflow-tooltip /> @@ -115,7 +115,7 @@ <span v-else>-</span> </template> </el-table-column> - + <!-- 鎿嶄綔鍒� --> <el-table-column fixed="right" label="鎿嶄綔" width="200" align="center"> <template #default="scope"> @@ -125,22 +125,22 @@ </template> </el-table-column> </el-table> - + <!-- 鍒嗛〉 --> - <pagination - v-show="total > 0" - :total="total" + <pagination + v-show="total > 0" + :total="total" layout="total, sizes, prev, pager, next, jumper" - :page="page.current" - :limit="page.size" - @pagination="paginationChange" + :page="page.current" + :limit="page.size" + @pagination="paginationChange" /> </div> <!-- 鏂板/缂栬緫棰勮瑙勫垯寮圭獥 --> - <el-dialog - v-model="dialogFormVisible" - :title="operationType === 'add' ? '鏂板棰勮瑙勫垯' : '缂栬緫棰勮瑙勫垯'" + <el-dialog + v-model="dialogFormVisible" + :title="operationType === 'add' ? '鏂板棰勮瑙勫垯' : '缂栬緫棰勮瑙勫垯'" width="50%" @close="closeDialog" > @@ -158,7 +158,7 @@ </el-form-item> </el-col> </el-row> - + <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="鍌ㄦ皵缃愮被鍨嬶細" prop="tankType"> @@ -176,7 +176,7 @@ </el-form-item> </el-col> </el-row> - + <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="瀹圭Н(m鲁)锛�" prop="volume"> @@ -189,7 +189,7 @@ </el-form-item> </el-col> </el-row> - + <!-- 搴撳瓨鐩稿叧 --> <el-row :gutter="20"> <el-col :span="12"> @@ -203,7 +203,7 @@ </el-form-item> </el-col> </el-row> - + <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="鏈�楂樻皵浣撻噺(%)锛�" prop="maxGasLevel"> @@ -216,7 +216,7 @@ </el-form-item> </el-col> </el-row> - + <!-- 棰勮瑙勫垯 --> <el-row :gutter="20"> <el-col :span="12"> @@ -239,7 +239,7 @@ </el-form-item> </el-col> </el-row> - + <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="棰勮闃堝�硷細" prop="warningThreshold"> @@ -252,15 +252,15 @@ </el-form-item> </el-col> </el-row> - + <!-- 鏃堕棿鐩稿叧 --> <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="棰勮鏃堕棿锛�" prop="warningTime"> - <el-date-picker - v-model="form.warningTime" - type="datetime" - placeholder="璇烽�夋嫨棰勮鏃堕棿" + <el-date-picker + v-model="form.warningTime" + type="datetime" + placeholder="璇烽�夋嫨棰勮鏃堕棿" style="width: 100%" value-format="YYYY-MM-DD HH:mm:ss" /> @@ -268,24 +268,24 @@ </el-col> <el-col :span="12"> <el-form-item label="棰勮鍏呰鏃堕棿锛�" prop="expectedRefillTime"> - <el-date-picker - v-model="form.expectedRefillTime" - type="datetime" - placeholder="璇烽�夋嫨棰勮鍏呰鏃堕棿" + <el-date-picker + v-model="form.expectedRefillTime" + type="datetime" + placeholder="璇烽�夋嫨棰勮鍏呰鏃堕棿" style="width: 100%" value-format="YYYY-MM-DD HH:mm:ss" /> </el-form-item> </el-col> </el-row> - + <el-row :gutter="20"> <el-col :span="12"> <el-form-item label="棰勮缂烘皵鏃堕棿锛�" prop="expectedShortageTime"> - <el-date-picker - v-model="form.expectedShortageTime" - type="datetime" - placeholder="璇烽�夋嫨棰勮缂烘皵鏃堕棿" + <el-date-picker + v-model="form.expectedShortageTime" + type="datetime" + placeholder="璇烽�夋嫨棰勮缂烘皵鏃堕棿" style="width: 100%" value-format="YYYY-MM-DD HH:mm:ss" /> @@ -293,17 +293,17 @@ </el-col> <el-col :span="12"> <el-form-item label="棰勮瑙勫垯鎻忚堪锛�" prop="warningRule"> - <el-input - v-model="form.warningRule" - type="textarea" - :rows="3" + <el-input + v-model="form.warningRule" + type="textarea" + :rows="3" placeholder="璇疯緭鍏ラ璀﹁鍒欐弿杩�" /> </el-form-item> </el-col> </el-row> </el-form> - + <template #footer> <div class="dialog-footer"> <el-button @click="closeDialog">鍙栨秷</el-button> @@ -460,19 +460,19 @@ // 鑾峰彇鍊掕鏃朵俊鎭� const getCountdown = (expectedTime) => { if (!expectedTime) return { text: '-', isExpired: false } - + const now = new Date().getTime() const expected = new Date(expectedTime).getTime() const diff = expected - now - + if (diff <= 0) { return { text: '宸茬己姘�', isExpired: true } } - + const days = Math.floor(diff / (1000 * 60 * 60 * 24)) const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)) - + if (days > 0) { return { text: `${days}澶�${hours}灏忔椂`, isExpired: false } } else if (hours > 0) { @@ -485,11 +485,11 @@ // 鑾峰彇鍊掕鏃舵牱寮忕被 const getCountdownClass = (expectedTime) => { if (!expectedTime) return '' - + const now = new Date().getTime() const expected = new Date(expectedTime).getTime() const diff = expected - now - + if (diff <= 0) { return 'countdown-expired' } else if (diff <= 24 * 60 * 60 * 1000) { // 24灏忔椂鍐� @@ -519,7 +519,7 @@ const showShortageWarning = (tank) => { currentWarningTank.value = tank shortageWarningVisible.value = true - + // 鎾斁鎻愮ず闊筹紙鍙�夛級 // const audio = new Audio('/path/to/warning-sound.mp3') // audio.play() @@ -642,7 +642,7 @@ ElMessage.warning('璇烽�夋嫨瑕佸鐞嗙殑棰勮') return } - + try { // 妯℃嫙API璋冪敤寤惰繜 await new Promise(resolve => setTimeout(resolve, 500)) @@ -725,10 +725,10 @@ const submitForm = async () => { try { await proxy.$refs.formRef.validate() - + // 妯℃嫙API璋冪敤寤惰繜 // await new Promise(resolve => setTimeout(resolve, 500)) - + if (operationType.value === 'add') { addStockWarning(form).then(res => { if(res.code == 200){ @@ -755,7 +755,7 @@ }) // ElMessage.success('缂栬緫鎴愬姛') } - + // closeDialog() // getList() } catch (error) { @@ -846,89 +846,89 @@ <style scoped lang="scss"> .app-container { padding: 20px; - + .table-operations { text-align: right; margin-bottom: 20px; - + .el-button { margin-right: 10px; } } - + .table_list { background: #fff; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } - + .text-danger { color: #f56c6c; font-weight: bold; } - + .text-warning { color: #e6a23c; font-weight: bold; } - + .text-success { color: #67c23a; font-weight: bold; } - + .dialog-footer { text-align: right; } - + // 鍊掕鏃舵牱寮� .countdown-timer { font-weight: bold; } - + .countdown-normal { color: #67c23a; } - + .countdown-warning { color: #e6a23c; } - + .countdown-urgent { color: #f56c6c; animation: blink 1s infinite; } - + .countdown-expired { color: #f56c6c; font-weight: bold; } - + @keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0.5; } } - + // 缂烘皵棰勮寮规鏍峰紡 .shortage-warning-content { text-align: center; padding: 20px 0; - + .warning-icon { margin-bottom: 20px; } - + .warning-message { h3 { color: #f56c6c; margin-bottom: 10px; } - + p { margin-bottom: 10px; color: #606266; } - + .warning-details { background: #f5f7fa; padding: 15px; -- Gitblit v1.9.3