From 1ea0d85b0fe2e7e4427fd484a9342d964c831b3d Mon Sep 17 00:00:00 2001 From: zhouwx <1175765986@qq.com> Date: 星期三, 06 八月 2025 15:15:00 +0800 Subject: [PATCH] 修改 --- src/views/hazardousChemicals/accessRecords/components/rawTable.vue | 29 +++++++++++++++++++++++++---- 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/views/hazardousChemicals/accessRecords/components/rawTable.vue b/src/views/hazardousChemicals/accessRecords/components/rawTable.vue index 8ecba7f..d1cda31 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" /> @@ -30,7 +30,7 @@ <el-table-column label="二维码识别号" prop="code" align="center" /> <el-table-column label="类型" prop="hazmatBasic.productSn" align="center" > <template #default="scope"> - <span>{{scope.row.state === 0 ? '入库' :scope.row.state === 1 ? '取用' :scope.row.state === 2 ? '归还' : scope.row.state === 3? '标签作废':''}}</span> + <span>{{scope.row.state === 0 ? '入库' :scope.row.state === 1 ? '取用' :scope.row.state === 2 ? '归还' : scope.row.state === 3? '标签作废':scope.row.state === 4 ? '用尽登记':scope.row.state === 5? '销售': scope.row.state === 6?'零头入库':''}}</span> </template> </el-table-column> <el-table-column label="数量" prop="num" align="center" width="120" > @@ -56,7 +56,7 @@ /> <el-dialog v-model="dialogVisible" - width="600px" + width="650px" :before-close="handleClose" :close-on-press-escape="false" :close-on-click-modal="false" @@ -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