提交 4847502e authored 作者: lidongxu's avatar lidongxu

Merge branch 'ap'

...@@ -3,12 +3,15 @@ ...@@ -3,12 +3,15 @@
<!-- 操作类型 --> <!-- 操作类型 -->
<el-row> <el-row>
<el-form-item> <el-form-item>
<el-radio-group v-model="operation" @change="handleChange"> <el-radio-group v-model="operation"
@change="handleChange">
<el-radio-button label="大区战区-分析" <el-radio-button label="大区战区-分析"
value="大区战区-分析" value="大区战区-分析"
v-hasPermi="['promotion:dashboard:list-show']" /> v-hasPermi="['promotion:dashboard:list-show']" />
<el-radio-button label="城市经理-分析" <el-radio-button label="城市经理-分析"
value="城市经理-分析" /> value="城市经理-分析" />
<el-radio-button label="经销商-分析"
value="经销商-分析" />
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -37,7 +40,8 @@ ...@@ -37,7 +40,8 @@
:label="col.label" :label="col.label"
:prop="col.prop" :prop="col.prop"
align="center" align="center"
:width="col.width"> :width="col.width"
:fixed="col.fixed">
</el-table-column> </el-table-column>
</template> </template>
</el-table> </el-table>
...@@ -45,6 +49,7 @@ ...@@ -45,6 +49,7 @@
</template> </template>
<script setup> <script setup>
import userStore from '@/store/modules/user' import userStore from '@/store/modules/user'
const props = defineProps({ const props = defineProps({
tableData: { // 数据源 tableData: { // 数据源
...@@ -66,7 +71,11 @@ const props = defineProps({ ...@@ -66,7 +71,11 @@ const props = defineProps({
formatter: { // 格式化函数 formatter: { // 格式化函数
type: Function, type: Function,
default: (row, col, cellValue) => cellValue default: (row, col, cellValue) => cellValue
} },
queryParams: { // 查询参数
type: Object,
default: () => ({})
},
}) })
const emit = defineEmits(['getTableList']) const emit = defineEmits(['getTableList'])
...@@ -98,25 +107,62 @@ onMounted(() => { ...@@ -98,25 +107,62 @@ onMounted(() => {
// 初始化列选择的函数 // 初始化列选择的函数
const initColumns = () => { const initColumns = () => {
if (operation.value === '大区战区-分析') { if (operation.value === '大区战区-分析') {
chooseColumns.value = props.baseColumns.filter(item => item.prop !== 'cityManager') chooseColumns.value = [{
label: "大区",
prop: "regionName",
width: 100,
childCol: [],
fixed: 'left'
},
{
label: "战区",
prop: "districtName",
childCol: [],
}].concat(props.baseColumns)
} else if (operation.value === '经销商-分析') {
chooseColumns.value = [{
label: '经销商',
prop: "dealerName",
childCol: [],
width: 120,
fixed: 'left'
},
{
label: '经销商编码',
prop: "dealerCode",
childCol: [],
}].concat(props.baseColumns)
} else { } else {
chooseColumns.value = props.baseColumns chooseColumns.value = [{
label: "大区",
prop: "regionName",
childCol: [],
fixed: 'left'
},
{
label: "战区",
prop: "districtName",
childCol: [],
},
{
label: "城市经理",
prop: "cityManager",
childCol: [],
}].concat(props.baseColumns)
} }
} }
watch(operation, (newVal) => { watch(operation, () => {
// 如果是大区战区-分析,则隐藏城市经理列 // 如果是大区战区-分析,则隐藏城市经理列
if (newVal === '大区战区-分析') { initColumns()
chooseColumns.value = props.baseColumns.filter(item => item.prop !== 'cityManager')
} else {
chooseColumns.value = props.baseColumns
}
}, { }, {
immediate: true immediate: true
}) })
// 切换操作类型时触发的函数 // 切换操作类型时触发的函数
const handleChange = (newVal) => { const handleChange = (newVal) => {
console.log('table', newVal)
props.queryParams.operation = newVal
emit('getTableList', newVal) emit('getTableList', newVal)
} }
......
...@@ -9,22 +9,6 @@ export const getDisplayConfig = () => { ...@@ -9,22 +9,6 @@ export const getDisplayConfig = () => {
// width: 100, // width: 100,
// childCol: [] // childCol: []
// }, // },
{
label: "大区",
prop: "regionName",
childCol: []
},
{
label: "战区",
prop: "districtName",
childCol: [],
width: 110
},
{
label: "城市经理",
prop: "cityManager",
childCol: []
},
{ {
label: '主货架', label: '主货架',
prop: "mainShelf", prop: "mainShelf",
...@@ -40,7 +24,6 @@ export const getDisplayConfig = () => { ...@@ -40,7 +24,6 @@ export const getDisplayConfig = () => {
{ {
label: '执行率', label: '执行率',
prop: "msExecRate", prop: "msExecRate",
width: 90
} }
] ]
}, },
...@@ -59,7 +42,6 @@ export const getDisplayConfig = () => { ...@@ -59,7 +42,6 @@ export const getDisplayConfig = () => {
{ {
label: '执行率', label: '执行率',
prop: "endcapExecRate", prop: "endcapExecRate",
width: 90
} }
] ]
}, },
...@@ -78,7 +60,6 @@ export const getDisplayConfig = () => { ...@@ -78,7 +60,6 @@ export const getDisplayConfig = () => {
{ {
label: '执行率', label: '执行率',
prop: "gsExecRate", prop: "gsExecRate",
width: 90
} }
] ]
}, },
...@@ -97,7 +78,6 @@ export const getDisplayConfig = () => { ...@@ -97,7 +78,6 @@ export const getDisplayConfig = () => {
{ {
label: '执行率', label: '执行率',
prop: "mpDispExecRate", prop: "mpDispExecRate",
width: 90
} }
] ]
}, },
...@@ -116,7 +96,6 @@ export const getDisplayConfig = () => { ...@@ -116,7 +96,6 @@ export const getDisplayConfig = () => {
{ {
label: '执行率', label: '执行率',
prop: "HsExecRate", prop: "HsExecRate",
width: 90
} }
] ]
} }
...@@ -131,21 +110,6 @@ export const getSchedulePlanConfig = (submitChange) => { ...@@ -131,21 +110,6 @@ export const getSchedulePlanConfig = (submitChange) => {
// prop: "salesMonth", // prop: "salesMonth",
// width: 100 // width: 100
// }, // },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{ {
label: '大区反馈', label: '大区反馈',
prop: "regionFeedback", prop: "regionFeedback",
...@@ -161,7 +125,6 @@ export const getSchedulePlanConfig = (submitChange) => { ...@@ -161,7 +125,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{ {
label: '执行率', label: '执行率',
prop: "launchRatePromoPeriExec", prop: "launchRatePromoPeriExec",
width: 90
} }
] ]
}, },
...@@ -176,7 +139,6 @@ export const getSchedulePlanConfig = (submitChange) => { ...@@ -176,7 +139,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{ {
label: '执行率', label: '执行率',
prop: "psExecRatePromoPeriExec", prop: "psExecRatePromoPeriExec",
width: 90
} }
] ]
}, },
...@@ -191,7 +153,6 @@ export const getSchedulePlanConfig = (submitChange) => { ...@@ -191,7 +153,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{ {
label: '执行率', label: '执行率',
prop: "pfExecRatePromoPeriExec", prop: "pfExecRatePromoPeriExec",
width: 90
} }
] ]
}, },
...@@ -206,7 +167,6 @@ export const getSchedulePlanConfig = (submitChange) => { ...@@ -206,7 +167,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{ {
label: '执行率', label: '执行率',
prop: "ppExecRatePromoPeriExec", prop: "ppExecRatePromoPeriExec",
width: 90
} }
] ]
}, },
...@@ -225,7 +185,6 @@ export const getSchedulePlanConfig = (submitChange) => { ...@@ -225,7 +185,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{ {
label: '执行率', label: '执行率',
prop: "posterExecRate", prop: "posterExecRate",
width: 90
} }
] ]
}, },
...@@ -240,21 +199,7 @@ export const getScheduleDisConfig = (submitChange) => { ...@@ -240,21 +199,7 @@ export const getScheduleDisConfig = (submitChange) => {
// prop: "salesMonth", // prop: "salesMonth",
// width: 100 // width: 100
// }, // },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{ {
label: '端架', label: '端架',
prop: "endShelf", prop: "endShelf",
...@@ -320,21 +265,7 @@ export const getSnackCofing = (submitChange) => { ...@@ -320,21 +265,7 @@ export const getSnackCofing = (submitChange) => {
// prop: "salesMonth", // prop: "salesMonth",
// width: 100 // width: 100
// }, // },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{ {
label: '计划', label: '计划',
prop: "planSnackStoreCnt", prop: "planSnackStoreCnt",
...@@ -358,21 +289,7 @@ export const getThreeTwoSecondsConfig = (submitChange) => { ...@@ -358,21 +289,7 @@ export const getThreeTwoSecondsConfig = (submitChange) => {
// prop: "salesMonth", // prop: "salesMonth",
// width: 100 // width: 100
// }, // },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{ {
label: '计划', label: '计划',
prop: "planSLStoreCnt", prop: "planSLStoreCnt",
...@@ -396,21 +313,7 @@ export const getSixLittleDiamondsConfig = (submitChange) => { ...@@ -396,21 +313,7 @@ export const getSixLittleDiamondsConfig = (submitChange) => {
// prop: "salesMonth", // prop: "salesMonth",
// width: 100 // width: 100
// }, // },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{ {
label: '计划', label: '计划',
prop: "planSixJdStoreCnt", prop: "planSixJdStoreCnt",
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData" <CustomTable :tableData="tableData"
:baseColumns="baseColumns" :baseColumns="baseColumns"
:isLoading="isLoading" :isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList" @getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" /> @updateShowSearch="v => showSearch.value = v" />
</template> </template>
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
<script setup <script setup
lang="jsx"> lang="jsx">
import CustomTable from '../components/Table' import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api' import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { getDisplayConfig } from './data.jsx' import { getDisplayConfig } from './data.jsx'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
...@@ -35,32 +36,44 @@ ...@@ -35,32 +36,44 @@
// 表格数据 // 表格数据
const queryParams = reactive({ const queryParams = reactive({
salesMonth: new Date(), salesMonth: new Date(),
operation: ''
}) })
const tableData = ref([]) const tableData = ref([])
const isLoading = ref(true) const isLoading = ref(true)
const total = ref(0) const total = ref(0)
// 筛选列表数据 // 筛选列表数据
const getTableList = async (operation) => { const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({ const res = await apiObj[queryParams.operation]({
...queryParams, ...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}') salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
}) })
if (operation === '大区战区-分析') { if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化 // 合并战区大区结构为扁平化
const { zq, dq } = res.data const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq] tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else { } else {
// 合并城市经理结构为扁平化
tableData.value = res.data tableData.value = res.data
} }
isLoading.value = false isLoading.value = false
} }
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show']) onMounted(() => {
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析') const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script> </script>
<style lang="scss"> <style lang="scss">
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<CustomTable :tableData="tableData" <CustomTable :tableData="tableData"
:baseColumns="baseColumns" :baseColumns="baseColumns"
:isLoading="isLoading" :isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList" @getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" /> @updateShowSearch="v => showSearch.value = v" />
</template> </template>
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
<script setup <script setup
lang="jsx"> lang="jsx">
import CustomTable from '../components/Table' import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api' import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getSchedulePlanConfig } from './data.jsx' import { getSchedulePlanConfig } from './data.jsx'
...@@ -68,29 +69,42 @@ ...@@ -68,29 +69,42 @@
// 表格数据 // 表格数据
const queryParams = reactive({ const queryParams = reactive({
salesMonth: new Date(), salesMonth: new Date(),
operation: ''
}) })
const tableData = ref([]) const tableData = ref([])
const isLoading = ref(true) const isLoading = ref(true)
const total = ref(0) const total = ref(0)
// 筛选列表数据 // 筛选列表数据
const getTableList = async (operation) => { const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({ const res = await apiObj[queryParams.operation]({
...queryParams, ...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}') salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
}) })
if (operation === '大区战区-分析') { if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化 // 合并战区大区结构为扁平化
const { zq, dq } = res.data const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq] tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else { } else {
// 合并城市经理结构为扁平化
tableData.value = res.data tableData.value = res.data
} }
isLoading.value = false isLoading.value = false
} }
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析') onMounted(() => {
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script> </script>
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData" <CustomTable :tableData="tableData"
:baseColumns="baseColumns" :baseColumns="baseColumns"
:isLoading="isLoading" :isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList" @getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" /> @updateShowSearch="v => showSearch.value = v" />
</template> </template>
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
<script setup <script setup
lang="jsx"> lang="jsx">
import CustomTable from '../components/Table' import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api' import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getScheduleDisConfig } from './data' import { getScheduleDisConfig } from './data'
...@@ -61,33 +62,46 @@ ...@@ -61,33 +62,46 @@
// 全部列 // 全部列
const baseColumns = ref(getScheduleDisConfig(submitChange)); const baseColumns = ref(getScheduleDisConfig(submitChange));
// 表格数据
const queryParams = reactive({ const queryParams = reactive({
salesMonth: new Date(), salesMonth: new Date(),
operation: ''
}) })
const tableData = ref([]) const tableData = ref([])
const isLoading = ref(true) const isLoading = ref(true)
const total = ref(0) const total = ref(0)
// 筛选列表数据 // 筛选列表数据
const getTableList = async (operation) => { const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({ const res = await apiObj[queryParams.operation]({
...queryParams, ...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}') salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
}) })
if (operation === '大区战区-分析') { if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化 // 合并战区大区结构为扁平化
const { zq, dq } = res.data const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq] tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else { } else {
// 合并城市经理结构为扁平化
tableData.value = res.data tableData.value = res.data
} }
isLoading.value = false isLoading.value = false
} }
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show']) onMounted(() => {
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析') const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script> </script>
\ No newline at end of file
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData" <CustomTable :tableData="tableData"
:baseColumns="baseColumns" :baseColumns="baseColumns"
:isLoading="isLoading" :isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList" @getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" /> @updateShowSearch="v => showSearch.value = v" />
</template> </template>
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
<script setup <script setup
lang="jsx"> lang="jsx">
import CustomTable from '../components/Table' import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api' import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { getSixLittleDiamondsConfig } from './data.jsx' import { getSixLittleDiamondsConfig } from './data.jsx'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
...@@ -64,30 +65,43 @@ ...@@ -64,30 +65,43 @@
// 表格数据 // 表格数据
const queryParams = reactive({ const queryParams = reactive({
salesMonth: new Date(), salesMonth: new Date(),
operation: ''
}) })
const tableData = ref([]) const tableData = ref([])
const isLoading = ref(true) const isLoading = ref(true)
const total = ref(0) const total = ref(0)
// 筛选列表数据 // 筛选列表数据
const getTableList = async (operation) => { const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({ const res = await apiObj[queryParams.operation]({
...queryParams, ...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}') salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
}) })
if (operation === '大区战区-分析') { if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化 // 合并战区大区结构为扁平化
const { zq, dq } = res.data const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq] tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else { } else {
// 合并城市经理结构为扁平化
tableData.value = res.data tableData.value = res.data
} }
isLoading.value = false isLoading.value = false
} }
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析') onMounted(() => {
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script> </script>
<style scoped></style> <style scoped></style>
\ No newline at end of file
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData" <CustomTable :tableData="tableData"
:baseColumns="baseColumns" :baseColumns="baseColumns"
:isLoading="isLoading" :isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList" @getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" /> @updateShowSearch="v => showSearch.value = v" />
</template> </template>
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
<script setup <script setup
lang="jsx"> lang="jsx">
import CustomTable from '../components/Table' import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api' import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
import { getSnackCofing } from './data.jsx'; import { getSnackCofing } from './data.jsx';
...@@ -60,31 +61,44 @@ ...@@ -60,31 +61,44 @@
// 表格数据 // 表格数据
const queryParams = reactive({ const queryParams = reactive({
salesMonth: new Date(), salesMonth: new Date(),
operation: ''
}) })
const tableData = ref([]) const tableData = ref([])
const isLoading = ref(true) const isLoading = ref(true)
const total = ref(0) const total = ref(0)
// 筛选列表数据 // 筛选列表数据
const getTableList = async (operation) => { const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({ const res = await apiObj[queryParams.operation]({
...queryParams, ...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}') salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
}) })
if (operation === '大区战区-分析') { if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化 // 合并战区大区结构为扁平化
const { zq, dq } = res.data const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq] tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else { } else {
// 合并城市经理结构为扁平化
tableData.value = res.data tableData.value = res.data
} }
isLoading.value = false isLoading.value = false
} }
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show']) onMounted(() => {
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析') const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script> </script>
<style scoped <style scoped
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData" <CustomTable :tableData="tableData"
:baseColumns="baseColumns" :baseColumns="baseColumns"
:isLoading="isLoading" :isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList" @getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" /> @updateShowSearch="v => showSearch.value = v" />
</template> </template>
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
<script setup <script setup
lang="jsx"> lang="jsx">
import CustomTable from '../components/Table' import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api' import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { getThreeTwoSecondsConfig } from './data.jsx' import { getThreeTwoSecondsConfig } from './data.jsx'
import { parseTime } from '@/utils' import { parseTime } from '@/utils'
...@@ -66,30 +67,43 @@ ...@@ -66,30 +67,43 @@
// 表格数据 // 表格数据
const queryParams = reactive({ const queryParams = reactive({
salesMonth: new Date(), salesMonth: new Date(),
operation: ''
}) })
const tableData = ref([]) const tableData = ref([])
const isLoading = ref(true) const isLoading = ref(true)
const total = ref(0) const total = ref(0)
// 筛选列表数据 // 筛选列表数据
const getTableList = async (operation) => { const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({ const res = await apiObj[queryParams.operation]({
...queryParams, ...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}') salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
}) })
if (operation === '大区战区-分析') { if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化 // 合并战区大区结构为扁平化
const { zq, dq } = res.data const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq] tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else { } else {
// 合并城市经理结构为扁平化
tableData.value = res.data tableData.value = res.data
} }
isLoading.value = false isLoading.value = false
} }
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析') onMounted(() => {
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script> </script>
......
...@@ -41,8 +41,6 @@ ...@@ -41,8 +41,6 @@
placeholder="请选择筛选状态" placeholder="请选择筛选状态"
@change="handleChange" @change="handleChange"
clearable> clearable>
<el-option label="全部"
value="全部" />
<el-option label="未执行" <el-option label="未执行"
value="未执行" /> value="未执行" />
</el-select> </el-select>
......
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
<el-tooltip class="item" <el-tooltip class="item"
effect="dark" effect="dark"
content="下载表格" content="下载表格"
placement="top"> placement="top"
v-if="tabsType === '常规陈列'">
<el-button @click="downloadTable" <el-button @click="downloadTable"
type="primary" type="primary"
v-hasPermi="['display_downExcel']"> v-hasPermi="['display_downExcel']">
...@@ -42,7 +43,8 @@ ...@@ -42,7 +43,8 @@
<el-tooltip class="item" <el-tooltip class="item"
effect="dark" effect="dark"
content="上传表格" content="上传表格"
placement="top"> placement="top"
v-if="tabsType === '常规陈列'">
<el-button @click="uploadExcel" <el-button @click="uploadExcel"
type="success" type="success"
v-hasPermi="['display_upExcel']"> v-hasPermi="['display_upExcel']">
...@@ -137,6 +139,7 @@ ...@@ -137,6 +139,7 @@
:close-on-press-escape="false" :close-on-press-escape="false"
draggable draggable
overflow overflow
body-class="dialog-table-container"
@close="handleDialogCloseUpload"> @close="handleDialogCloseUpload">
<div class="table-container"> <div class="table-container">
<!-- 计划表格 --> <!-- 计划表格 -->
...@@ -304,6 +307,7 @@ const downloadTable = async () => { ...@@ -304,6 +307,7 @@ const downloadTable = async () => {
const res = await downloadDisplayScheduleTable({ const res = await downloadDisplayScheduleTable({
...props.params, ...props.params,
salesMonth: parseTime(props.params.salesMonth, '{y}-{m}'), salesMonth: parseTime(props.params.salesMonth, '{y}-{m}'),
rqStatus: props.params.rqStatus === '全部' ? null : props.params.rqStatus,
pageNum: null, pageNum: null,
pageSize: null, pageSize: null,
pageType: typeObj[props.tabsType] pageType: typeObj[props.tabsType]
...@@ -655,22 +659,37 @@ const tableRowStyle = ({ row }) => { ...@@ -655,22 +659,37 @@ const tableRowStyle = ({ row }) => {
} }
// 上传表格确认框内表格的样式
.el-table {
::v-deep(.error-row) { </style>
--el-table-tr-bg-color: var(--el-color-error-light-9);
}
/* 灰色过期行颜色 */ <style lang="scss">
::v-deep(.timeout-row) { // 上传表格确认框内表格的样式
--el-table-tr-bg-color: var(--el-timeout-row); .dialog-table-container {
} overflow-y: hidden !important;
// 消除滚动条
::-webkit-scrollbar {
display: none;
} }
</style> .table-container {
height: 100%;
overflow-y: scroll;
.el-table {
::v-deep(.error-row) {
--el-table-tr-bg-color: var(--el-color-error-light-9);
}
/* 灰色过期行颜色 */
::v-deep(.timeout-row) {
--el-table-tr-bg-color: var(--el-timeout-row);
}
}
}
}
<style lang="scss">
/* 表格弹窗 */ /* 表格弹窗 */
.table-dialog-modal { .table-dialog-modal {
padding: 0; padding: 0;
...@@ -726,5 +745,9 @@ const tableRowStyle = ({ row }) => { ...@@ -726,5 +745,9 @@ const tableRowStyle = ({ row }) => {
input { input {
color: red !important; color: red !important;
} }
// 下拉框
.el-select__placeholder {
color: red !important;
}
} }
</style> </style>
\ No newline at end of file
...@@ -488,7 +488,8 @@ export const getDisplayConfig = (submitChange) => { ...@@ -488,7 +488,8 @@ export const getDisplayConfig = (submitChange) => {
submitChange(row, col); submitChange(row, col);
}} }}
disabled={disabled} disabled={disabled}
class={{ 'no-disabled': row[col.referenceKey] }} style={{ color: '#ff0000' }}
class={{ 'no-disabled': row[col.referenceKey], 'red-text': row[col.prop] > row[col.referenceKey] }}
placeholder="" placeholder=""
clearable> clearable>
{col.options.map(item => ( {col.options.map(item => (
...@@ -635,7 +636,7 @@ export const getDisplayConfig = (submitChange) => { ...@@ -635,7 +636,7 @@ export const getDisplayConfig = (submitChange) => {
submitChange(row, col); submitChange(row, col);
}} }}
disabled={!row.actualFloorStackArea || disabled} disabled={!row.actualFloorStackArea || disabled}
class={{ 'no-disabled': row.actualFloorStackArea && row[col.referenceKey] }} class={{ 'no-disabled': row.actualFloorStackArea && row[col.referenceKey], 'red-text': row[col.prop] > row[col.referenceKey] }}
placeholder="" placeholder=""
clearable> clearable>
{col.options.map(item => ( {col.options.map(item => (
...@@ -3316,17 +3317,17 @@ export const getSnackCofing = (submitChange) => { ...@@ -3316,17 +3317,17 @@ export const getSnackCofing = (submitChange) => {
"width": 150, "width": 150,
func: (row) => { func: (row) => {
if ((row.plannedDisplay && row.actualDisplay === '执行与计划一致')) { if ((row.plannedDisplay && row.actualDisplay === '执行与计划一致')) {
// 判断实际端架数量为 0 或者空时就是未执行,如果小于计划是部分执行,如果大于等于就是执行 // 判断端架数量实际>=端架数量计划时为执行
if (!row.actualEndCapQty || row.actualEndCapQty == 0) { if (row.actualEndCapQty >= row.plannedEndCapQty) {
row.snackDisplayExecuted = '未执行'
} else {
row.snackDisplayExecuted = '执行' row.snackDisplayExecuted = '执行'
} else {
row.snackDisplayExecuted = '未执行'
} }
} else { } else {
row.snackDisplayExecuted = '未执行' row.snackDisplayExecuted = '未执行'
} }
}, },
formulaStr: "公式:陈列形式执行,并且端架数量执行(某项无计划时,忽略该项)" formulaStr: "公式:陈列形式执行,并且端架数量实际>=端架数量计划(某项无计划时,忽略该项)"
}, },
{ {
"label": "计划 - 陈列费用", "label": "计划 - 陈列费用",
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
isLoading.value = true isLoading.value = true
const res = await getDisplayList({ const res = await getDisplayList({
...params.value, ...params.value,
rqStatus: params.value.rqStatus === '全部' ? '' : params.value.rqStatus,
salesMonth: parseTime(params.value.salesMonth, '{y}-{m}') salesMonth: parseTime(params.value.salesMonth, '{y}-{m}')
}) })
res.data.rows.forEach(item => { res.data.rows.forEach(item => {
......
...@@ -104,7 +104,6 @@ ...@@ -104,7 +104,6 @@
isLoading.value = true isLoading.value = true
const res = await getDisplayScheduleList({ const res = await getDisplayScheduleList({
...params.value, ...params.value,
rqStatus: params.value.rqStatus === '全部' ? '' : params.value.rqStatus,
salesMonth: parseTime(params.value.salesMonth, '{y}-{m}') salesMonth: parseTime(params.value.salesMonth, '{y}-{m}')
}) })
// 处理日期格式 // 处理日期格式
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
isLoading.value = true isLoading.value = true
const res = await getDisplayScheduleDetail({ const res = await getDisplayScheduleDetail({
...params.value, ...params.value,
rqStatus: params.value.rqStatus === '全部' ? '' : params.value.rqStatus,
salesMonth: parseTime(params.value.salesMonth, '{y}-{m}') salesMonth: parseTime(params.value.salesMonth, '{y}-{m}')
}) })
res.data.rows.forEach(item => { res.data.rows.forEach(item => {
......
...@@ -73,7 +73,6 @@ ...@@ -73,7 +73,6 @@
isLoading.value = true isLoading.value = true
getSixLittleDiamondsPlanList({ getSixLittleDiamondsPlanList({
...params.value, ...params.value,
rqStatus: params.value.rqStatus === '全部' ? '' : params.value.rqStatus,
salesMonth: parseTime(params.value.salesMonth, '{y}-{m}') salesMonth: parseTime(params.value.salesMonth, '{y}-{m}')
}).then(res => { }).then(res => {
isLoading.value = false isLoading.value = false
......
...@@ -108,7 +108,6 @@ ...@@ -108,7 +108,6 @@
isLoading.value = true isLoading.value = true
const res = await getSnackPlanList({ const res = await getSnackPlanList({
...params.value, ...params.value,
rqStatus: params.value.rqStatus === '全部' ? '' : params.value.rqStatus,
salesMonth: parseTime(params.value.salesMonth, '{y}-{m}') salesMonth: parseTime(params.value.salesMonth, '{y}-{m}')
}) })
res.data.rows.forEach(item => { res.data.rows.forEach(item => {
......
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
isLoading.value = true isLoading.value = true
getThreeMetersTwoSecondsPlanList({ getThreeMetersTwoSecondsPlanList({
...params.value, ...params.value,
rqStatus: params.value.rqStatus === '全部' ? '' : params.value.rqStatus,
salesMonth: proxy.parseTime(params.value.salesMonth, '{y}-{m}') salesMonth: proxy.parseTime(params.value.salesMonth, '{y}-{m}')
}).then(res => { }).then(res => {
isLoading.value = false isLoading.value = false
......
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
:label="col.label" :label="col.label"
:prop="col.prop" :prop="col.prop"
align="center" align="center"
:width="col.width"> :width="col.width"
:fixed="col.fixed">
</el-table-column> </el-table-column>
</template> </template>
</el-table> </el-table>
...@@ -109,6 +110,8 @@ const initColumns = () => { ...@@ -109,6 +110,8 @@ const initColumns = () => {
label: "大区", label: "大区",
prop: "regionName", prop: "regionName",
childCol: [], childCol: [],
width: 100,
fixed: 'left'
}, },
{ {
label: "战区", label: "战区",
...@@ -120,7 +123,8 @@ const initColumns = () => { ...@@ -120,7 +123,8 @@ const initColumns = () => {
label: '经销商', label: '经销商',
prop: "dealerName", prop: "dealerName",
childCol: [], childCol: [],
width: 220 width: 220,
fixed: 'left'
}, },
{ {
label: '经销商编码', label: '经销商编码',
...@@ -132,6 +136,7 @@ const initColumns = () => { ...@@ -132,6 +136,7 @@ const initColumns = () => {
label: "大区", label: "大区",
prop: "regionName", prop: "regionName",
childCol: [], childCol: [],
fixed: 'left'
}, },
{ {
label: "战区", label: "战区",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论