From 48d5ab35c3fcdc6edca1278d1474a1b54a431191 Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期三, 21 八月 2024 16:00:33 +0800 Subject: [PATCH] bug修改 --- src/views/hazardousChemicals/accessRecords/components/rawTable.vue | 25 +++++++++++++++++++++++-- 1 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/views/hazardousChemicals/accessRecords/components/rawTable.vue b/src/views/hazardousChemicals/accessRecords/components/rawTable.vue index 4e7c531..891ae47 100644 --- a/src/views/hazardousChemicals/accessRecords/components/rawTable.vue +++ b/src/views/hazardousChemicals/accessRecords/components/rawTable.vue @@ -22,7 +22,7 @@ </el-form> </div> <!-- 表格数据 --> - <el-table v-loading="loading" :data="dataList" :border="true"> + <el-table v-loading="loading" :data="dataList" :border="true" :cell-style="cellStyle"> <el-table-column label="序号" type="index" align="center" width="80" /> <el-table-column label="流转时间" prop="updateTime" align="center" width="120"/> <el-table-column label="品名" prop="hazmatBasic.name" align="center" /> @@ -112,7 +112,6 @@ } getList() }) - const getList = async () => { loading.value = true const res = await getRawFlow(data.queryParams) @@ -185,6 +184,28 @@ const getProRecord = (val) => { dialogRef.value.openDialog(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 (columnIndex === 6 || columnIndex === 5){ + if(row.num > 0){ + return { color:' green' } + }else{ + return { color:' red' } + } + + } + + } + } +}; defineExpose({ getList -- Gitblit v1.9.2