提交 95fffa10 authored 作者: lidongxu's avatar lidongxu

refactor(promotion): 修改:店内执行上报_非当月是灰色背景

上级 758981bd
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
clearable> clearable>
<el-option label="全部" <el-option label="全部"
value="" /> value="" />
<el-option label="未填写" <el-option label="未执行"
value="未执行" /> value="未执行" />
</el-select> </el-select>
</el-form-item> </el-form-item>
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
class="auto-fit-header-table" class="auto-fit-header-table"
v-loading="isLoading" v-loading="isLoading"
show-overflow-tooltip show-overflow-tooltip
:class="{ 'cell-no-padding': operation === '填报模式' }"> :class="{ 'cell-no-padding': operation === '填报模式' }"
:row-style="tableRowStyle">
<template v-for="col in tableColumns"> <template v-for="col in tableColumns">
<el-table-column v-if="col.visible" <el-table-column v-if="col.visible"
:label="col.label" :label="col.label"
...@@ -72,7 +73,7 @@ ...@@ -72,7 +73,7 @@
<!-- 自定义渲染内容单元格 --> <!-- 自定义渲染内容单元格 -->
<div v-if="col.render" <div v-if="col.render"
class="cell-style"> class="cell-style">
<component :is="col.render(h, row, col)" /> <component :is="col.render(h, row, col, !isCurrentMonth(row.salesMonth))" />
</div> </div>
<!-- 公式计算 --> <!-- 公式计算 -->
<div v-else-if="col.type === 'formula'"> <div v-else-if="col.type === 'formula'">
...@@ -270,6 +271,28 @@ const handleDialogClose = () => { ...@@ -270,6 +271,28 @@ const handleDialogClose = () => {
// 然后关闭弹窗 // 然后关闭弹窗
showTableInDialog.value = false showTableInDialog.value = false
} }
/*************** 非当月置灰行 ***************/
// 获取当前月份的函数
const getCurrentMonth = () => {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
return `${year}-${month}`;
};
// 检查是否为当前月的函数
const isCurrentMonth = (salesMonth) => {
return salesMonth === getCurrentMonth();
};
// 行样式函数
const tableRowStyle = ({ row }) => {
if (!isCurrentMonth(row.salesMonth)) {
return { backgroundColor: '#f5f7fa' }; // 灰色背景
}
return {};
};
</script> </script>
<style scoped <style scoped
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论