修改媒体历史数据展示
This commit is contained in:
parent
2cb4a07886
commit
48e750152c
|
@ -167,8 +167,7 @@ const handleGeoConvertBack = () => {
|
|||
|
||||
// 获取通知
|
||||
const getNoticeList = () => {
|
||||
noticeList({ noticeType: 1, status: 0 }).then(res => {
|
||||
console.log('通知结果', res)
|
||||
noticeList({ noticeType: 1, status: 0 }).then(res => {
|
||||
notices.value = res.rows
|
||||
})
|
||||
}
|
||||
|
|
|
@ -262,14 +262,11 @@ const handleSubmit = () => {
|
|||
})
|
||||
}
|
||||
// 获取历史报价
|
||||
const getMediaPrice = (_mediaId, _showOptionColumn) => {
|
||||
console.log('走了这里?')
|
||||
const getMediaPrice = (_mediaId, _showOptionColumn) => {
|
||||
showOptionColumn.value = _showOptionColumn
|
||||
if (_mediaId) {
|
||||
mediaPrice({ mediaId: _mediaId }).then(res => {
|
||||
console.log('查询到报价', res.data)
|
||||
quotationList.value = res.data.filter(item => item.mediaType == 6)
|
||||
console.log('过滤后数据', quotationList.value)
|
||||
mediaPrice({ mediaId: _mediaId }).then(res => {
|
||||
quotationList.value = res.data.filter(item => item.mediaType == 6)
|
||||
quotationList.value.forEach(element => {
|
||||
element.currentImageSrc = defaultImageSrc.value
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<!-- 历史数据对话框 -->
|
||||
<el-dialog title="历史数据" v-model="historyDataOpen" width="1250px" class="my_dialog" align-center
|
||||
<el-dialog title="历史数据" v-model="historyDataOpen" width="1400px" class="my_dialog" align-center
|
||||
:destroy-on-close="true" :close-on-click-modal="false">
|
||||
<div v-loading="loading">
|
||||
<el-form :inline="true" :model="queryParams" class="myInsertForm">
|
||||
|
@ -12,6 +12,12 @@
|
|||
<el-date-picker v-model="queryParams.endTime" format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss" type="date" placeholder="结束时间" @change="validateEndTime" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型:" v-if="!readonly">
|
||||
<el-select v-model="mediaType" placeholder="请选择" style="min-width: 120px;" clearable @change="handleChangeMediaType" >
|
||||
<el-option v-for="item in mediaTypes" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="charsType" @change="handleChangeType">
|
||||
<el-radio value="1">折线图</el-radio>
|
||||
|
@ -23,18 +29,138 @@
|
|||
<el-button type="primary" class="primaryBtn" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div id="historyChar" ref="historyCharRef"></div>
|
||||
<el-table :data="historyList" height="368px">
|
||||
<el-table-column label="媒体名称" align="left" prop="mediaName" />
|
||||
<el-table-column label="供应商名称" prop="supplier" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="折扣" prop="discount" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="媒体净价(元)" prop="mediaRegularPrice" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="实际报价(元)" prop="listPrice" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTIme" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
<el-empty v-if="xData.length == 0" description="无数据" />
|
||||
<div v-else id="historyChar" ref="historyCharRef"></div>
|
||||
<el-table :data="historyList" border height="285px">
|
||||
<template v-if="readonly">
|
||||
<el-table-column label="城市/市场" align="center" prop="cityName" width="100" />
|
||||
<el-table-column label="媒体形式/名称" align="left" prop="mediaName" width="150" />
|
||||
<el-table-column label="频次" align="center" prop="frequency" width="130" />
|
||||
<el-table-column label="统一对外刊例价" align="right" prop="listPrice" width="150" />
|
||||
<el-table-column label="单位" align="center" prop="listPriceUnit" width="120" />
|
||||
<el-table-column label="实际购买频次" align="center" prop="actualBuyFrequency" width="130" />
|
||||
<el-table-column label="实际购买刊例价" align="right" prop="actualBuyListPrice" width="140" />
|
||||
<el-table-column label="购买周期" align="right" prop="buyCycle" width="120" />
|
||||
<el-table-column label="折扣" align="center" prop="discount" width="100" />
|
||||
<el-table-column label="媒体总净价" align="right" prop="mediaRegularPrice" width="120" />
|
||||
<el-table-column label="总制作费" align="right" prop="totalMakeFee" width="130" />
|
||||
<el-table-column label="总净价" align="right" prop="totalRegularPrice" width="120" />
|
||||
<el-table-column label="供应商" align="left" prop="supplier" width="150" />
|
||||
<el-table-column label="项目名称" align="left" prop="projectName" width="150" />
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-if="mediaType == 1">
|
||||
<el-table-column label="城市" align="center" prop="cityName" width="90" />
|
||||
<el-table-column label="媒体名称" align="left" prop="mediaName" width="150" />
|
||||
<el-table-column label="频次" align="center" prop="frequency" width="100" />
|
||||
<el-table-column label="投放数量" align="right" prop="putTotal" width="100" />
|
||||
<el-table-column label="起购周期" align="right" prop="buyCycle" width="120" />
|
||||
<el-table-column label="刊例价" align="right" prop="listPrice" width="120" />
|
||||
<el-table-column label="刊例价单位" align="center" prop="listPriceUnit" width="120" />
|
||||
<el-table-column label="实际购买刊例价" align="right" prop="actualBuyListPrice" width="140" />
|
||||
<el-table-column label="实际购买刊例价单位" align="center" prop="actualBuyListPriceUnit" width="170" />
|
||||
<el-table-column label="折扣" align="center" prop="discount" width="100" />
|
||||
<el-table-column label="媒体总净价" align="right" prop="mediaRegularPrice" width="120" />
|
||||
<el-table-column label="首次制作安装费" align="right" prop="firstInstallFee" width="150" />
|
||||
<el-table-column label="总制作费" align="right" prop="totalMakeFee" width="130" />
|
||||
<el-table-column label="供应商" align="left" prop="supplier" width="150" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<template v-if="mediaType == 2">
|
||||
<el-table-column label="城市" align="center" prop="cityName" width="90" />
|
||||
<el-table-column label="资源描述" align="left" prop="resourceRemark" width="150" />
|
||||
<el-table-column label="媒体名称" align="left" prop="mediaName" width="150" />
|
||||
<el-table-column label="频次" align="center" prop="frequency" width="100" />
|
||||
<el-table-column label="发布总量" align="right" prop="releaseTotal" width="120" />
|
||||
<el-table-column label="购买周期" align="right" prop="buyCycle" width="120" />
|
||||
<el-table-column label="刊例价" align="right" prop="listPrice" width="120" />
|
||||
<el-table-column label="刊例价单位" align="center" prop="listPriceUnit" width="120" />
|
||||
<el-table-column label="实际购买刊例价" align="right" prop="actualBuyListPrice" width="140" />
|
||||
<el-table-column label="实际购买刊例价单位" align="center" prop="actualBuyListPriceUnit" width="170" />
|
||||
<el-table-column label="折扣" align="center" prop="discount" width="100" />
|
||||
<el-table-column label="媒体总净价" align="right" prop="mediaRegularPrice" width="120" />
|
||||
<el-table-column label="首次制作安装费" align="right" prop="firstInstallFee" width="150" />
|
||||
<el-table-column label="总制作费" align="right" prop="totalMakeFee" width="130" />
|
||||
<el-table-column label="总净价" align="right" prop="totalRegularPrice" width="120" />
|
||||
<el-table-column label="总净价单位" align="center" prop="totalRegularPriceUnit" width="130" />
|
||||
<el-table-column label="供应商" align="left" prop="supplier" width="150" />
|
||||
</template>
|
||||
<template v-if="mediaType == 3">
|
||||
<el-table-column label="城市" align="center" prop="cityName" width="90" />
|
||||
<el-table-column label="媒体名称" align="left" prop="mediaName" width="150" />
|
||||
<el-table-column label="频次" align="center" prop="frequency" width="100" />
|
||||
<el-table-column label="发布总量" align="right" prop="releaseTotal" width="120" />
|
||||
<el-table-column label="最短购买周期" align="right" prop="buyCycle" width="130" />
|
||||
<el-table-column label="刊例价" align="right" prop="listPrice" width="120" />
|
||||
<el-table-column label="刊例价单位" align="center" prop="listPriceUnit" width="120" />
|
||||
<el-table-column label="折扣" align="center" prop="discount" width="100" />
|
||||
<el-table-column label="媒体总净价" align="right" prop="mediaRegularPrice" width="120" />
|
||||
<el-table-column label="首次制作安装费" align="right" prop="firstInstallFee" width="150" />
|
||||
<el-table-column label="总制作费" align="right" prop="totalMakeFee" width="130" />
|
||||
<el-table-column label="总净价" align="right" prop="totalRegularPrice" width="120" />
|
||||
<el-table-column label="总净价单位" align="center" prop="totalRegularPriceUnit" width="130" />
|
||||
<el-table-column label="供应商" align="left" prop="supplier" width="150" />
|
||||
</template>
|
||||
<template v-if="mediaType == 4">
|
||||
<el-table-column label="城市" align="center" prop="cityName" width="90" />
|
||||
<el-table-column label="线路" align="center" prop="subwayLine" width="150" />
|
||||
<el-table-column label="站点" align="center" prop="station" width="130" />
|
||||
<el-table-column label="级别" align="center" prop="level" width="100" />
|
||||
<el-table-column label="媒体形式" align="center" prop="mediaFormat" width="120" />
|
||||
<el-table-column label="媒体名称" align="left" prop="mediaName" width="150" />
|
||||
<el-table-column label="起投周期" align="right" prop="buyCycle" width="120" />
|
||||
<el-table-column label="投放周期" align="right" prop="deliverCycle" width="120" />
|
||||
<el-table-column label="购买数量" align="right" prop="buyTotal" width="120" />
|
||||
<el-table-column label="购买数量单位" align="center" prop="buyTotalUnit" width="130" />
|
||||
<el-table-column label="频次" align="center" prop="frequency" width="100" />
|
||||
<el-table-column label="刊例价" align="right" prop="listPrice" width="120" />
|
||||
<el-table-column label="刊例价单位" align="center" prop="listPriceUnit" width="120" />
|
||||
<el-table-column label="实际购买刊例价" align="right" prop="actualBuyListPrice" width="140" />
|
||||
<el-table-column label="实际购买刊例价单位" align="center" prop="actualBuyListPriceUnit" width="170" />
|
||||
<el-table-column label="媒体总净价" align="right" prop="mediaRegularPrice" width="120" />
|
||||
<el-table-column label="媒体总净价单位" align="center" prop="mediaRegularPriceUnit" width="140" />
|
||||
<el-table-column label="常规制作费" align="right" prop="commonMakeFee" width="130" />
|
||||
<el-table-column label="创意制作费" align="right" prop="ideaMakeFee" width="130" />
|
||||
<el-table-column label="总制作费" align="right" prop="totalMakeFee" width="130" />
|
||||
<el-table-column label="总净价" align="right" prop="totalRegularPrice" width="120" />
|
||||
<el-table-column label="总净价单位" align="center" prop="totalRegularPriceUnit" width="130" />
|
||||
<el-table-column label="供应商" align="left" prop="supplier" width="150" />
|
||||
</template>
|
||||
<template v-if="mediaType == 5">
|
||||
<el-table-column label="城市" align="center" prop="cityName" width="90" />
|
||||
<el-table-column label="场站" align="center" prop="station" width="130" />
|
||||
<el-table-column label="媒体位置" align="left" prop="mediaName" width="150" />
|
||||
<el-table-column label="频次" align="center" prop="frequency" width="100" />
|
||||
<el-table-column label="发布总量" align="right" prop="releaseTotal" width="120" />
|
||||
<el-table-column label="购买周期" align="right" prop="buyCycle" width="120" />
|
||||
<el-table-column label="刊例价" align="right" prop="listPrice" width="120" />
|
||||
<el-table-column label="刊例价单位" align="center" prop="listPriceUnit" width="120" />
|
||||
<el-table-column label="折扣" align="center" prop="discount" width="100" />
|
||||
<el-table-column label="媒体总净价" align="right" prop="mediaRegularPrice" width="120" />
|
||||
<el-table-column label="首次制作安装费" align="right" prop="firstInstallFee" width="150" />
|
||||
<el-table-column label="总制作费" align="right" prop="totalMakeFee" width="130" />
|
||||
<el-table-column label="总净价" align="right" prop="totalRegularPrice" width="120" />
|
||||
<el-table-column label="总净价单位" align="center" prop="totalRegularPriceUnit" width="130" />
|
||||
<el-table-column label="供应商" align="left" prop="supplier" width="150" />
|
||||
</template>
|
||||
<template v-if="mediaType == 6 || mediaType == 7">
|
||||
<el-table-column label="城市" align="center" prop="cityName" width="90" />
|
||||
<el-table-column label="媒体名称" align="left" prop="mediaName" width="150" />
|
||||
<el-table-column label="频次" align="center" prop="frequency" width="100" />
|
||||
<el-table-column label="发布总量" align="right" prop="releaseTotal" width="120" />
|
||||
<el-table-column label="购买周期" align="right" prop="buyCycle" width="120" />
|
||||
<el-table-column label="刊例价" align="right" prop="listPrice" width="120" />
|
||||
<el-table-column label="刊例价单位" align="center" prop="listPriceUnit" width="120" />
|
||||
<el-table-column label="实际购买刊例价" align="right" prop="actualBuyListPrice" width="140" />
|
||||
<el-table-column label="实际购买刊例价单位" align="center" prop="actualBuyListPriceUnit" width="170" />
|
||||
<el-table-column label="折扣" align="center" prop="discount" width="100" />
|
||||
<el-table-column label="媒体总净价" align="right" prop="mediaRegularPrice" width="120" />
|
||||
<el-table-column label="首次制作安装费" align="right" prop="firstInstallFee" width="150" />
|
||||
<el-table-column label="总制作费" align="right" prop="totalMakeFee" width="130" />
|
||||
<el-table-column label="总净价" align="right" prop="totalRegularPrice" width="120" />
|
||||
<el-table-column label="总净价单位" align="center" prop="totalRegularPriceUnit" width="130" />
|
||||
<el-table-column label="供应商" align="left" prop="supplier" width="150" />
|
||||
</template>
|
||||
</template>
|
||||
</el-table>
|
||||
|
||||
<!-- <pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
|
@ -66,6 +192,22 @@ const queryParams = ref({
|
|||
endTime: undefined,
|
||||
})
|
||||
|
||||
// 媒体类型
|
||||
const readonly = ref(false)
|
||||
const mediaType = ref(1)
|
||||
|
||||
// 0-优势 1-门禁 2-候车厅 3-道闸 4-地铁 5-高铁 6-写字楼 7-车库灯箱
|
||||
const mediaTypes = ref([
|
||||
// { value: 0, label: '优势' },
|
||||
{ value: 1, label: '门禁' },
|
||||
{ value: 2, label: '候车厅' },
|
||||
{ value: 3, label: '道闸' },
|
||||
{ value: 4, label: '地铁' },
|
||||
{ value: 5, label: '高铁' },
|
||||
{ value: 6, label: '写字楼' },
|
||||
{ value: 7, label: '车库灯箱' },
|
||||
])
|
||||
|
||||
const _historyChar = ref(null)
|
||||
// 折线图
|
||||
const initHistoryCharLine = () => {
|
||||
|
@ -74,10 +216,10 @@ const initHistoryCharLine = () => {
|
|||
_historyChar.value.setOption({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: "{b} : {c} 元/年" //鼠标放上去 展示内容
|
||||
formatter: "{b} : {c} 元/天" //鼠标放上去 展示内容
|
||||
},
|
||||
grid: {
|
||||
left: '4%',
|
||||
left: '3%',
|
||||
right: '3%', // 右侧留更多空间显示长数值
|
||||
top: '14%',
|
||||
bottom: '10%',
|
||||
|
@ -107,7 +249,7 @@ const initHistoryCharLine = () => {
|
|||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: '实际报价(元/年)',
|
||||
name: '实际报价(元/天)',
|
||||
nameTextStyle: {
|
||||
color: '#3B3B3B',
|
||||
fontSize: 16,
|
||||
|
@ -151,6 +293,9 @@ const initHistoryCharLine = () => {
|
|||
}
|
||||
]
|
||||
})
|
||||
// window.addEventListener("resize", () => {
|
||||
// _historyChar.value.resize()
|
||||
// })
|
||||
}
|
||||
// 柱状图
|
||||
const initHistoryCharBar = () => {
|
||||
|
@ -159,10 +304,10 @@ const initHistoryCharBar = () => {
|
|||
_historyChar.value.setOption({
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: "{b} : {c} 元/年" //鼠标放上去 展示内容
|
||||
formatter: "{b} : {c} 元/天" //鼠标放上去 展示内容
|
||||
},
|
||||
grid: {
|
||||
left: '4%',
|
||||
left: '3%',
|
||||
right: '3%', // 右侧留更多空间显示长数值
|
||||
top: '14%',
|
||||
bottom: '10%',
|
||||
|
@ -192,7 +337,7 @@ const initHistoryCharBar = () => {
|
|||
},
|
||||
},
|
||||
yAxis: {
|
||||
name: '实际报价(元/年)',
|
||||
name: '实际报价(元/天)',
|
||||
nameTextStyle: {
|
||||
color: '#3B3B3B',
|
||||
fontSize: 16,
|
||||
|
@ -240,14 +385,17 @@ const initHistoryCharBar = () => {
|
|||
}]
|
||||
})
|
||||
// window.addEventListener("resize", () => {
|
||||
// _vehicleTrainBarChart.value.resize()
|
||||
// _historyChar.value.resize()
|
||||
// })
|
||||
}
|
||||
|
||||
const handleChangeMediaType = (val) => {
|
||||
getMediaPriceList()
|
||||
}
|
||||
const handleChangeType = (val) => {
|
||||
charsType.value = val
|
||||
getMediaPriceList()
|
||||
}
|
||||
|
||||
const handleQuery = () => {
|
||||
getMediaPriceList()
|
||||
}
|
||||
|
@ -259,14 +407,29 @@ const resetQuery = () => {
|
|||
|
||||
const getMediaPriceList = () => {
|
||||
loading.value = true
|
||||
console.log('查询参数', queryParams.value)
|
||||
mediaPrice(queryParams.value).then(res => {
|
||||
historyList.value = res.data
|
||||
if (readonly.value) historyList.value = res.data.filter(item => item.mediaType == 0)
|
||||
else historyList.value = res.data.filter(item => item.mediaType == mediaType.value)
|
||||
xData.value = []
|
||||
yData.value = []
|
||||
res.data.forEach(item => {
|
||||
historyList.value.forEach(item => {
|
||||
xData.value.push(item.supplier)
|
||||
yData.value.push(parseFloat(item.listPrice))
|
||||
let itemYDate = null;
|
||||
const convertIntTotalRegularPrice = parseFloat(item.totalRegularPrice.replace(/,/g, ''))
|
||||
if (readonly.value) itemYDate = (convertIntTotalRegularPrice / item.buyCycle).toFixed(2)
|
||||
else {
|
||||
// 判断是否纯数字
|
||||
const convertIntValue = safeParseInt(item.buyCycle)
|
||||
if (typeof convertIntValue === 'number' && Number.isFinite(convertIntValue)) {
|
||||
itemYDate = (convertIntTotalRegularPrice / (item.buyCycle * 7)).toFixed(2)
|
||||
} else {
|
||||
const repliceValue = parseInt(item.buyCycle.replace('个月', '').replace('月', ''))
|
||||
console.log('会输入月份的原始值', item.buyCycle)
|
||||
console.log('替换会输入月份的结果', repliceValue)
|
||||
itemYDate = (convertIntTotalRegularPrice / (repliceValue * 31)).toFixed(2)
|
||||
}
|
||||
}
|
||||
yData.value.push(itemYDate)
|
||||
});
|
||||
if (xData.value.length > 0) {
|
||||
nextTick(() => {
|
||||
|
@ -277,6 +440,11 @@ const getMediaPriceList = () => {
|
|||
loading.value = false
|
||||
})
|
||||
}
|
||||
const safeParseInt = (str) => {
|
||||
// 匹配可选的正负号后跟纯数字(不支持小数点或其他字符)
|
||||
const isValid = /^[+-]?\d+$/.test(str);
|
||||
return isValid ? parseInt(str, 10) : NaN; // 无效时返回 NaN
|
||||
}
|
||||
// 校验开始时间是否超过结束时间
|
||||
const validateStartTime = (val) => {
|
||||
if (val && queryParams.value.endTime && new Date(val) > new Date(queryParams.value.endTime)) {
|
||||
|
@ -295,8 +463,9 @@ const validateEndTime = (val) => {
|
|||
}
|
||||
};
|
||||
// 对外暴漏方法
|
||||
const initHistoryData = (_mediaId) => {
|
||||
const initHistoryData = (_mediaId, _readonly) => {
|
||||
historyDataOpen.value = true
|
||||
readonly.value = _readonly
|
||||
nextTick(() => {
|
||||
if (_mediaId) {
|
||||
queryParams.value.mediaId = _mediaId
|
||||
|
|
|
@ -572,7 +572,8 @@ const handleAbolish = (row) => {
|
|||
}
|
||||
// 打开历史数据
|
||||
const handleHistoryChart = (row) => {
|
||||
historyDataRef.value.initHistoryData(row.id)
|
||||
const isReadonly = row.dataScopeDeptId == 220 ? true : false
|
||||
historyDataRef.value.initHistoryData(row.id, isReadonly)
|
||||
}
|
||||
// 打开文件下载
|
||||
const handleDownFiles = (row) => {
|
||||
|
|
|
@ -208,8 +208,7 @@ const getCurrentTime = () => {
|
|||
}
|
||||
// 获取使用统计
|
||||
const getStatistics = () => {
|
||||
pptAnalysisStatistics().then(res => {
|
||||
console.log('统计信息', res)
|
||||
pptAnalysisStatistics().then(res => {
|
||||
detailForm.value = res
|
||||
})
|
||||
|
||||
|
@ -217,8 +216,7 @@ const getStatistics = () => {
|
|||
// 获取分析任务列表
|
||||
const getTaskRecordPageList = () => {
|
||||
loading.value = true
|
||||
pptAnalysisTaskPageList(queryParams.value).then(res => {
|
||||
console.log('分析任务列表', res)
|
||||
pptAnalysisTaskPageList(queryParams.value).then(res => {
|
||||
taskList.value = res.tasks
|
||||
total.value = res.pagination.total
|
||||
loading.value = false
|
||||
|
|
Loading…
Reference in New Issue
Block a user