提交 591b2a9a authored 作者: lidongxu's avatar lidongxu

style(promotion): 修复:勤策App移动端_店内执行上报看板冻结列以及新增经销商部分

上级 33fe785f
......@@ -3,12 +3,15 @@
<!-- 操作类型 -->
<el-row>
<el-form-item>
<el-radio-group v-model="operation" @change="handleChange">
<el-radio-group v-model="operation"
@change="handleChange">
<el-radio-button label="大区战区-分析"
value="大区战区-分析"
v-hasPermi="['promotion:dashboard:list-show']" />
<el-radio-button label="城市经理-分析"
value="城市经理-分析" />
<el-radio-button label="经销商-分析"
value="经销商-分析" />
</el-radio-group>
</el-form-item>
</el-row>
......@@ -37,7 +40,8 @@
:label="col.label"
:prop="col.prop"
align="center"
:width="col.width">
:width="col.width"
:fixed="col.fixed">
</el-table-column>
</template>
</el-table>
......@@ -45,6 +49,7 @@
</template>
<script setup>
import userStore from '@/store/modules/user'
const props = defineProps({
tableData: { // 数据源
......@@ -66,7 +71,11 @@ const props = defineProps({
formatter: { // 格式化函数
type: Function,
default: (row, col, cellValue) => cellValue
}
},
queryParams: { // 查询参数
type: Object,
default: () => ({})
},
})
const emit = defineEmits(['getTableList'])
......@@ -98,25 +107,62 @@ onMounted(() => {
// 初始化列选择的函数
const initColumns = () => {
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 {
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 === '大区战区-分析') {
chooseColumns.value = props.baseColumns.filter(item => item.prop !== 'cityManager')
} else {
chooseColumns.value = props.baseColumns
}
initColumns()
}, {
immediate: true
})
// 切换操作类型时触发的函数
const handleChange = (newVal) => {
console.log('table', newVal)
props.queryParams.operation = newVal
emit('getTableList', newVal)
}
......
......@@ -9,22 +9,6 @@ export const getDisplayConfig = () => {
// width: 100,
// childCol: []
// },
{
label: "大区",
prop: "regionName",
childCol: []
},
{
label: "战区",
prop: "districtName",
childCol: [],
width: 110
},
{
label: "城市经理",
prop: "cityManager",
childCol: []
},
{
label: '主货架',
prop: "mainShelf",
......@@ -40,7 +24,6 @@ export const getDisplayConfig = () => {
{
label: '执行率',
prop: "msExecRate",
width: 90
}
]
},
......@@ -59,7 +42,6 @@ export const getDisplayConfig = () => {
{
label: '执行率',
prop: "endcapExecRate",
width: 90
}
]
},
......@@ -78,7 +60,6 @@ export const getDisplayConfig = () => {
{
label: '执行率',
prop: "gsExecRate",
width: 90
}
]
},
......@@ -97,7 +78,6 @@ export const getDisplayConfig = () => {
{
label: '执行率',
prop: "mpDispExecRate",
width: 90
}
]
},
......@@ -116,7 +96,6 @@ export const getDisplayConfig = () => {
{
label: '执行率',
prop: "HsExecRate",
width: 90
}
]
}
......@@ -131,21 +110,6 @@ export const getSchedulePlanConfig = (submitChange) => {
// prop: "salesMonth",
// width: 100
// },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{
label: '大区反馈',
prop: "regionFeedback",
......@@ -161,7 +125,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{
label: '执行率',
prop: "launchRatePromoPeriExec",
width: 90
}
]
},
......@@ -176,7 +139,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{
label: '执行率',
prop: "psExecRatePromoPeriExec",
width: 90
}
]
},
......@@ -191,7 +153,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{
label: '执行率',
prop: "pfExecRatePromoPeriExec",
width: 90
}
]
},
......@@ -206,7 +167,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{
label: '执行率',
prop: "ppExecRatePromoPeriExec",
width: 90
}
]
},
......@@ -225,7 +185,6 @@ export const getSchedulePlanConfig = (submitChange) => {
{
label: '执行率',
prop: "posterExecRate",
width: 90
}
]
},
......@@ -240,21 +199,7 @@ export const getScheduleDisConfig = (submitChange) => {
// prop: "salesMonth",
// width: 100
// },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{
label: '端架',
prop: "endShelf",
......@@ -320,21 +265,7 @@ export const getSnackCofing = (submitChange) => {
// prop: "salesMonth",
// width: 100
// },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{
label: '计划',
prop: "planSnackStoreCnt",
......@@ -358,21 +289,7 @@ export const getThreeTwoSecondsConfig = (submitChange) => {
// prop: "salesMonth",
// width: 100
// },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{
label: '计划',
prop: "planSLStoreCnt",
......@@ -396,21 +313,7 @@ export const getSixLittleDiamondsConfig = (submitChange) => {
// prop: "salesMonth",
// width: 100
// },
{
label: "大区",
prop: "regionName",
width: 100
},
{
label: "战区",
prop: "districtName",
width: 100
},
{
label: "城市经理",
prop: "cityManager",
width: 100
},
{
label: '计划',
prop: "planSixJdStoreCnt",
......
......@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData"
:baseColumns="baseColumns"
:isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" />
</template>
......@@ -21,7 +22,7 @@
<script setup
lang="jsx">
import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { getDisplayConfig } from './data.jsx'
import { parseTime } from '@/utils'
......@@ -35,32 +36,44 @@
// 表格数据
const queryParams = reactive({
salesMonth: new Date(),
operation: ''
})
const tableData = ref([])
const isLoading = ref(true)
const total = ref(0)
// 筛选列表数据
const getTableList = async (operation) => {
const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({
const res = await apiObj[queryParams.operation]({
...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
})
if (operation === '大区战区-分析') {
if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化
const { zq, dq } = res.data
tableData.value = [...zq, ...dq]
const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else {
// 合并城市经理结构为扁平化
tableData.value = res.data
}
isLoading.value = false
}
const { proxy } = getCurrentInstance()
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析')
onMounted(() => {
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script>
<style lang="scss">
......
......@@ -15,6 +15,7 @@
<CustomTable :tableData="tableData"
:baseColumns="baseColumns"
:isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" />
</template>
......@@ -22,7 +23,7 @@
<script setup
lang="jsx">
import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { parseTime } from '@/utils'
import { getSchedulePlanConfig } from './data.jsx'
......@@ -68,29 +69,42 @@
// 表格数据
const queryParams = reactive({
salesMonth: new Date(),
operation: ''
})
const tableData = ref([])
const isLoading = ref(true)
const total = ref(0)
// 筛选列表数据
const getTableList = async (operation) => {
const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({
const res = await apiObj[queryParams.operation]({
...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
})
if (operation === '大区战区-分析') {
if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化
const { zq, dq } = res.data
tableData.value = [...zq, ...dq]
const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else {
// 合并城市经理结构为扁平化
tableData.value = res.data
}
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>
......@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData"
:baseColumns="baseColumns"
:isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" />
</template>
......@@ -21,7 +22,7 @@
<script setup
lang="jsx">
import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { parseTime } from '@/utils'
import { getScheduleDisConfig } from './data'
......@@ -61,33 +62,46 @@
// 全部列
const baseColumns = ref(getScheduleDisConfig(submitChange));
// 表格数据
const queryParams = reactive({
salesMonth: new Date(),
operation: ''
})
const tableData = ref([])
const isLoading = ref(true)
const total = ref(0)
// 筛选列表数据
const getTableList = async (operation) => {
const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({
const res = await apiObj[queryParams.operation]({
...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
})
if (operation === '大区战区-分析') {
if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化
const { zq, dq } = res.data
tableData.value = [...zq, ...dq]
const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else {
// 合并城市经理结构为扁平化
tableData.value = res.data
}
isLoading.value = false
}
const { proxy } = getCurrentInstance()
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析')
onMounted(() => {
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script>
\ No newline at end of file
......@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData"
:baseColumns="baseColumns"
:isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" />
</template>
......@@ -21,7 +22,7 @@
<script setup
lang="jsx">
import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { getSixLittleDiamondsConfig } from './data.jsx'
import { parseTime } from '@/utils'
......@@ -64,30 +65,43 @@
// 表格数据
const queryParams = reactive({
salesMonth: new Date(),
operation: ''
})
const tableData = ref([])
const isLoading = ref(true)
const total = ref(0)
// 筛选列表数据
const getTableList = async (operation) => {
const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({
const res = await apiObj[queryParams.operation]({
...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
})
if (operation === '大区战区-分析') {
if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化
const { zq, dq } = res.data
tableData.value = [...zq, ...dq]
const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else {
// 合并城市经理结构为扁平化
tableData.value = res.data
}
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>
<style scoped></style>
\ No newline at end of file
......@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData"
:baseColumns="baseColumns"
:isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" />
</template>
......@@ -21,7 +22,7 @@
<script setup
lang="jsx">
import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { parseTime } from '@/utils'
import { getSnackCofing } from './data.jsx';
......@@ -60,31 +61,44 @@
// 表格数据
const queryParams = reactive({
salesMonth: new Date(),
operation: ''
})
const tableData = ref([])
const isLoading = ref(true)
const total = ref(0)
// 筛选列表数据
const getTableList = async (operation) => {
const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({
const res = await apiObj[queryParams.operation]({
...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
})
if (operation === '大区战区-分析') {
if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化
const { zq, dq } = res.data
tableData.value = [...zq, ...dq]
const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else {
// 合并城市经理结构为扁平化
tableData.value = res.data
}
isLoading.value = false
}
const { proxy } = getCurrentInstance()
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
getTableList(isDaQuZQ ? '大区战区-分析' : '城市经理-分析')
onMounted(() => {
const isDaQuZQ = proxy.checkPermi(['promotion:dashboard:list-show'])
queryParams.operation = isDaQuZQ ? '大区战区-分析' : '城市经理-分析'
getTableList()
})
</script>
<style scoped
......
......@@ -14,6 +14,7 @@
<CustomTable :tableData="tableData"
:baseColumns="baseColumns"
:isLoading="isLoading"
:queryParams="queryParams"
@getTableList="getTableList"
@updateShowSearch="v => showSearch.value = v" />
</template>
......@@ -21,7 +22,7 @@
<script setup
lang="jsx">
import CustomTable from '../components/Table'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea } from '@/api'
import { getDisplayScheduleDashboardList, getDisplayScheduleDashboardListArea, getDisplayScheduleDashboardListStore } from '@/api'
import { getThreeTwoSecondsConfig } from './data.jsx'
import { parseTime } from '@/utils'
......@@ -66,30 +67,43 @@
// 表格数据
const queryParams = reactive({
salesMonth: new Date(),
operation: ''
})
const tableData = ref([])
const isLoading = ref(true)
const total = ref(0)
// 筛选列表数据
const getTableList = async (operation) => {
const apiObj = {
'大区战区-分析': getDisplayScheduleDashboardList,
'城市经理-分析': getDisplayScheduleDashboardListArea,
'经销商-分析': getDisplayScheduleDashboardListStore,
}
const getTableList = async () => {
isLoading.value = true
const res = await (operation === '大区战区-分析' ? getDisplayScheduleDashboardList : getDisplayScheduleDashboardListArea)({
const res = await apiObj[queryParams.operation]({
...queryParams,
salesMonth: parseTime(queryParams.salesMonth, '{y}-{m}')
})
if (operation === '大区战区-分析') {
if (queryParams.operation === '大区战区-分析') {
// 合并战区大区结构为扁平化
const { zq, dq } = res.data
tableData.value = [...zq, ...dq]
const { zq, dq, hz } = res.data
tableData.value = [...zq, ...dq, ...hz]
} else if (queryParams.operation === '经销商-分析') {
// 合并经销商结构为扁平化
const { dist, hz } = res.data
tableData.value = [...dist, ...hz]
} else {
// 合并城市经理结构为扁平化
tableData.value = res.data
}
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>
......
......@@ -40,7 +40,8 @@
:label="col.label"
:prop="col.prop"
align="center"
:width="col.width">
:width="col.width"
:fixed="col.fixed">
</el-table-column>
</template>
</el-table>
......@@ -109,6 +110,8 @@ const initColumns = () => {
label: "大区",
prop: "regionName",
childCol: [],
width: 100,
fixed: 'left'
},
{
label: "战区",
......@@ -120,7 +123,8 @@ const initColumns = () => {
label: '经销商',
prop: "dealerName",
childCol: [],
width: 220
width: 220,
fixed: 'left'
},
{
label: '经销商编码',
......@@ -132,6 +136,7 @@ const initColumns = () => {
label: "大区",
prop: "regionName",
childCol: [],
fixed: 'left'
},
{
label: "战区",
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论