From e39acb3659c059cbedc37ff6592ef7b3355bd20c Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期三, 09 十月 2024 10:46:59 +0800
Subject: [PATCH] bug修改

---
 src/views/hazardousChemicals/warehouseManage/components/rawDetail.vue     |    6 +++++-
 src/views/hazardousChemicals/electronicWarehouse/components/rawTable.vue  |   46 +++++++++++++++++++++++++++++++++-------------
 src/views/hazardousChemicals/electronicWarehouse/components/rawDetail.vue |    7 ++++++-
 3 files changed, 44 insertions(+), 15 deletions(-)

diff --git a/src/views/hazardousChemicals/electronicWarehouse/components/rawDetail.vue b/src/views/hazardousChemicals/electronicWarehouse/components/rawDetail.vue
index af05a7c..d24f7aa 100644
--- a/src/views/hazardousChemicals/electronicWarehouse/components/rawDetail.vue
+++ b/src/views/hazardousChemicals/electronicWarehouse/components/rawDetail.vue
@@ -257,11 +257,16 @@
   }
   for (let i = 0; i <= arr.length; i++) {
     if (arr[i] == row.basicId) {
-      if(row.remaining < row.hazmatBasic.metering){
+      if(row.state === 3 && row.remaining < row.hazmatBasic.metering){
         if (columnIndex === 11 || columnIndex === 10){
           return { color:' red' }
         }
+      }else if(row.remaining < row.hazmatBasic.metering){
+        if (columnIndex === 11 || columnIndex === 10){
+          return { color: '#ff9900' }
+        }
       }
+
     }
   }
 };
diff --git a/src/views/hazardousChemicals/electronicWarehouse/components/rawTable.vue b/src/views/hazardousChemicals/electronicWarehouse/components/rawTable.vue
index 0be5cc3..ab349a6 100644
--- a/src/views/hazardousChemicals/electronicWarehouse/components/rawTable.vue
+++ b/src/views/hazardousChemicals/electronicWarehouse/components/rawTable.vue
@@ -36,8 +36,32 @@
         </template>
       </el-table-column>
 <!--      <el-table-column label="批号" prop="batchNo" align="center" width="120" />-->
-      <el-table-column label="当前库存" prop="stock" align="center" width="120" />
-      <el-table-column label="不完整归还" prop="missStock" align="center" width="120" />
+      <el-table-column label="当前库存" prop="stock" align="center" width="120">
+        <template #default="scope">
+          <el-tooltip
+              v-if="scope.row.stock +scope.row.missStock < scope.row.hazmatBasic.safeNum"
+              class="box-item"
+              effect="light"
+              :content="`当前库存小于安全库存(${scope.row.hazmatBasic.safeNum})`"
+              placement="top"
+          >
+            <span style="cursor: pointer">{{scope.row.stock}}</span>
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column label="不完整归还" prop="missStock" align="center" width="120" >
+        <template #default="scope">
+          <el-tooltip
+              v-if="scope.row.stock +scope.row.missStock < scope.row.hazmatBasic.safeNum"
+              class="box-item"
+              effect="light"
+              :content="`当前库存小于安全库存(${scope.row.hazmatBasic.safeNum})`"
+              placement="top"
+          >
+            <span style="cursor: pointer">{{scope.row.missStock}}</span>
+          </el-tooltip>
+        </template>
+      </el-table-column>
       <el-table-column label="安全库存" prop="hazmatBasic.safeNum" align="center" width="120" />
       <el-table-column label="所在仓库" prop="warehouseName" align="center" >
       </el-table-column>
@@ -117,11 +141,6 @@
   const res = await getRawList(data.queryParams)
   if(res.code == 200){
     data.dataList = res.data.list
-    data.dataList.forEach(item => {
-      if(item.stock+item.missStock < item.hazmatBasic.safeNum){
-        selectValue.value.push(item)
-      }
-    })
     data.total = res.data.total
   }else{
     ElMessage.warning(res.message)
@@ -182,17 +201,18 @@
 
 const cellStyle = ({ row, column,rowIndex, columnIndex }) => {
   let arr = []
-  if (selectValue.value !== null) {
-    selectValue.value.filter((item, index) => {
+  if (data.dataList !== null) {
+    data.dataList.filter((item, index) => {
       arr.push(item.basicId)
     })
   }
   for (var i = 0; i <= arr.length; i++) {
-    if (arr[i] == row.basicId) {
-      if (columnIndex === 8 || columnIndex === 9 || columnIndex === 10){
-        return { backgroundColor: '#FFD7CC !important',color:' red' }
+    if (arr[i] === row.basicId) {
+      if(row.stock + row.missStock < row.hazmatBasic.safeNum){
+        if (columnIndex === 8 || columnIndex === 9){
+          return { backgroundColor: '#FFD7CC !important',color:' red' }
+        }
       }
-
     }
   }
 };
diff --git a/src/views/hazardousChemicals/warehouseManage/components/rawDetail.vue b/src/views/hazardousChemicals/warehouseManage/components/rawDetail.vue
index 4878301..77c8fe9 100644
--- a/src/views/hazardousChemicals/warehouseManage/components/rawDetail.vue
+++ b/src/views/hazardousChemicals/warehouseManage/components/rawDetail.vue
@@ -259,10 +259,14 @@
   }
   for (let i = 0; i <= arr.length; i++) {
     if (arr[i] == row.basicId) {
-      if(row.remaining < row.hazmatBasic.metering){
+      if(row.state === 3 && row.remaining < row.hazmatBasic.metering){
         if (columnIndex === 11 || columnIndex === 10){
           return { color:' red' }
         }
+      }else if(row.remaining < row.hazmatBasic.metering){
+        if (columnIndex === 11 || columnIndex === 10){
+          return { color: '#ff9900' }
+        }
       }
     }
   }

--
Gitblit v1.9.2