对接媒体导出接口

This commit is contained in:
wangchengming 2025-11-01 23:09:47 +08:00
parent 687b196fbe
commit cc4bbc4dbe
7 changed files with 360 additions and 60 deletions

View File

@ -97,6 +97,7 @@ export function updateUserPwd(oldPassword, newPassword) {
return request({
url: '/system/user/profile/updatePwd',
method: 'put',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
data: data
})
}

View File

@ -15,8 +15,8 @@ const useSettingsStore = defineStore(
state: () => ({
title: '',
theme: storageSetting.theme || '#409EFF',
sideTheme: storageSetting.sideTheme || sideTheme,
showSettings: showSettings,
sideTheme: 'theme-light', //storageSetting.sideTheme || sideTheme,
showSettings: false, //showSettings,
topNav: storageSetting.topNav === undefined ? topNav : storageSetting.topNav,
tagsView: storageSetting.tagsView === undefined ? tagsView : storageSetting.tagsView,
tagsIcon: storageSetting.tagsIcon === undefined ? tagsIcon : storageSetting.tagsIcon,
@ -25,7 +25,7 @@ const useSettingsStore = defineStore(
dynamicTitle: storageSetting.dynamicTitle === undefined ? dynamicTitle : storageSetting.dynamicTitle,
footerVisible: storageSetting.footerVisible === undefined ? footerVisible : storageSetting.footerVisible,
footerContent: footerContent,
isDark: isDark.value
isDark: false, // isDark.value
}),
actions: {
// 修改布局设置
@ -42,8 +42,8 @@ const useSettingsStore = defineStore(
},
// 切换暗黑模式
toggleTheme() {
this.isDark = !this.isDark
toggleDark()
// this.isDark = !this.isDark
// toggleDark()
}
}
})

View File

@ -34,7 +34,7 @@
</el-checkbox-group>
</el-tab-pane>
<el-tab-pane label="媒体报价信息" name="second">
<el-button-group class="mb10">
<el-button-group class="exportGroup mb10">
<el-button v-for="(item, index) in ToolOptions" :key="index"
:type="activeIndex === index ? 'primary' : 'default'" @click="handleChangeType(index)">
{{ item }}
@ -81,6 +81,170 @@ const exportOpen = ref(false)
const activeName = ref('first')
const curDeptIds = ref(null)
//
const ysBaseFild = ref([
{
displayName: "媒体名称",
propertyPath: "mediaName"
},
{
displayName: "媒体类型",
propertyPath: "mediaTypeStr"
},
{
displayName: "媒体大类",
propertyPath: "mediaCategoryStr"
},
{
displayName: "展示形式",
propertyPath: "displayFormStr"
},
{
displayName: "是否照明",
propertyPath: "hasLighting"
},
{
displayName: "播放时间",
propertyPath: "playbackTime"
},
{
displayName: "媒体尺寸",
propertyPath: "mediaSize"
},
{
displayName: "MR",
propertyPath: "mr"
},
{
displayName: "日均车流量",
propertyPath: "dailyAvgVehicleFlow"
},
{
displayName: "媒体朝向",
propertyPath: "mediaOrientation"
},
{
displayName: "省",
propertyPath: "provinceName"
},
{
displayName: "市",
propertyPath: "cityName"
},
{
displayName: "区",
propertyPath: "areaName"
},
{
displayName: "镇",
propertyPath: "townName"
},
{
displayName: "商圈",
propertyPath: "businessDistrictName"
},
{
displayName: "地址",
propertyPath: "address"
},
{
displayName: "纬度",
propertyPath: "mapY"
},
{
displayName: "经度",
propertyPath: "mapX"
},
{
displayName: "最小购买周期",
propertyPath: "minPurchaseCycle"
},
{
displayName: "首次制作安装费",
propertyPath: "firstInstallFee"
},
{
displayName: "换刊制作安装费",
propertyPath: "changeInstallFee"
},
{
displayName: "状态",
propertyPath: "state"
},
{
displayName: "作废原因",
propertyPath: "invalidReason"
},
{
displayName: "业务部门",
propertyPath: "dataScopeDeptName"
}
])
//
const wlBaseFild = ref([
{
displayName: "媒体名称",
propertyPath: "mediaName"
},
{
displayName: "媒体类型",
propertyPath: "mediaTypeStr"
},
{
displayName: "媒体大类",
propertyPath: "mediaCategoryStr"
},
{
displayName: "展示形式",
propertyPath: "displayFormStr"
},
{
displayName: "省",
propertyPath: "provinceName"
},
{
displayName: "市",
propertyPath: "cityName"
},
{
displayName: "区",
propertyPath: "areaName"
},
{
displayName: "镇",
propertyPath: "townName"
},
{
displayName: "商圈",
propertyPath: "businessDistrictName"
},
{
displayName: "地址",
propertyPath: "address"
},
{
displayName: "纬度",
propertyPath: "mapY"
},
{
displayName: "经度",
propertyPath: "mapX"
},
{
displayName: "状态",
propertyPath: "state"
},
{
displayName: "作废原因",
propertyPath: "invalidReason"
},
{
displayName: "业务部门",
propertyPath: "dataScopeDeptName"
}
])
//
const ysPriceFild = ref([
{
@ -1150,7 +1314,7 @@ const ckdxPriceFild = ref([
const exportForm = ref({
ids: undefined,
exportBaseFields: undefined,
exportPriceFields: false,
mediaTypeExport: [],
hasFiles: false
})
@ -1159,7 +1323,7 @@ const baseFieldCheckAll = ref(false)
const baseFieldIsIndeterminate = ref(false)
//
const baseFields = ref([])
const _baseFields = ref(null)
// const _baseFields = ref(null)
//
const checkedBaseFields = ref([])
@ -1196,19 +1360,95 @@ const handleCheckedBaseFieldChange = (value) => {
}
//
const handleCheckAllPriceFieldChange = (val) => {
console.log('全选报价字段', val)
checkedPriceFields.value = []
if (val) {
priceFields.value.forEach(element => {
checkedPriceFields.value.push(element.propertyPath)
});
if (ToolOptions.value.length == 8) {
console.log('待处理报价', exportForm.value.mediaTypeExport, activeIndex.value)
//
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == activeIndex.value);
if (curPriceFields.length > 0) {
console.log('过滤后的数据', curPriceFields[0].exportPriceFields)
curPriceFields[0].exportPriceFields = [...checkedPriceFields.value] // 使
}
}
if (ToolOptions.value.length == 7) {
let jsType = activeIndex.value + 1
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == jsType);
if (curPriceFields.length > 0) {
curPriceFields[0].exportPriceFields = [...checkedPriceFields.value] // 使
}
}
if (ToolOptions.value.length == 0) {
console.log('待处理报价', exportForm.value.mediaTypeExport, 0)
//
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == 0);
if (curPriceFields.length > 0) {
console.log('过滤后的数据', curPriceFields[0].exportPriceFields)
curPriceFields[0].exportPriceFields = [...checkedPriceFields.value] // 使
}
}
console.log('处理后的报价字段', exportForm.value.mediaTypeExport)
} else {
if (ToolOptions.value.length == 8) {
//
const curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == activeIndex.value);
if (curPriceFields.length > 0) {
curPriceFields[0].exportPriceFields = []
}
}
if (ToolOptions.value.length == 7) {
let jsType = activeIndex.value + 1
const curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == jsType);
if (curPriceFields.length > 0) {
curPriceFields[0].exportPriceFields = []
}
}
if (ToolOptions.value.length == 0) {
const curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == 0);
if (curPriceFields.length > 0) {
curPriceFields[0].exportPriceFields = []
}
}
console.log('处理后的报价字段', exportForm.value.mediaTypeExport)
}
priceFieldIsIndeterminate.value = false
//
checkPriceFieldSelectStatus()
}
//
const handleCheckedPriceFieldChange = (value) => {
console.log('单个选择报价字段', value)
const checkedCount = value.length
priceFieldCheckAll.value = checkedCount === priceFields.value.length
priceFieldIsIndeterminate.value = checkedCount > 0 && checkedCount < priceFields.value.length
// exportForm
if (ToolOptions.value.length == 8) {
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == activeIndex.value);
if (curPriceFields.length > 0) {
curPriceFields[0].exportPriceFields = [...value]
}
}
if (ToolOptions.value.length == 7) {
let jsType = activeIndex.value + 1
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == jsType);
if (curPriceFields.length > 0) {
curPriceFields[0].exportPriceFields = [...value]
}
}
if (ToolOptions.value.length == 0) {
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == 0);
if (curPriceFields.length > 0) {
curPriceFields[0].exportPriceFields = [...value]
}
}
//
checkPriceFieldSelectStatus()
}
//
@ -1224,7 +1464,7 @@ const handleClick = (tab, event) => {
//
const handleSubmitExport = () => {
exportForm.value.exportBaseFields = checkedBaseFields
exportForm.value.exportPriceFields = checkedPriceFields
exportForm.value.mediaTypeExport = exportForm.value.mediaTypeExport.filter(item => item.exportPriceFields.length > 0)
exportMediaExcel(exportForm.value).then(res => {
const downLoadName = '媒体信息_' + getCurrentTime() + '.xlsx'
// a
@ -1255,20 +1495,15 @@ const getCurrentTime = () => {
//
const getMediaExcelBaseField = () => {
mediaExcelBaseField().then(res => {
if (curDeptIds.value && curDeptIds.value.length == 2) baseFields.value = res.data
if (curDeptIds.value && curDeptIds.value.length == 2) baseFields.value = ysBaseFild.value
else if (curDeptIds.value && curDeptIds.value.length == 1) {
if (curDeptIds.value[0] == '219') {
//
_baseFields.value = "媒体名称,媒体类型,媒体大类,展示形式,省,市,区,镇,商圈,地址,经度,纬度,状态,废除原因, 部门"
baseFields.value = wlBaseFild.value
} else {
_baseFields.value = "媒体名称,媒体类型,媒体大类,展示形式,是否照明,播放时间,媒体尺寸,mr,日均车流量,媒体朝向,省,市,区,镇,商圈,地址,经度,纬度,最小购买周期,首次制作安装费,换刊制作安装费,状态,废除原因, 部门"
baseFields.value = ysBaseFild.value
}
baseFields.value = [...new Set( //
res.data.filter(item => _baseFields.value.includes(item.displayName))
)];
}
})
}
//
const getMediaExcelPriceField = () => {
@ -1276,93 +1511,153 @@ const getMediaExcelPriceField = () => {
ToolOptions.value = ['优势报价', '门禁', '候车厅', '道闸', '地铁', '高铁', '写字楼', '车库灯箱']
activeIndex.value = 0
priceFields.value = ysPriceFild.value
handleCheckPriceField(0)
}
else if (curDeptIds.value && curDeptIds.value.length == 1) {
if (curDeptIds.value[0] == '219') {
ToolOptions.value = ['门禁', '候车厅', '道闸', '地铁', '高铁', '写字楼', '车库灯箱']
activeIndex.value = 0
priceFields.value = mjPriceFild.value
handleCheckPriceField(1)
} else {
ToolOptions.value = []
activeIndex.value = 0
priceFields.value = ysPriceFild.value
handleCheckPriceField(0)
}
}
}
//
const handleCheckPriceField = (_mediaType) => {
//
const currentMediaTypeExport = [...exportForm.value.mediaTypeExport]; //
console.log('要导出的报价字段', currentMediaTypeExport)
//
const filteredFields = currentMediaTypeExport.filter(item => item.type !== _mediaType);
console.log('要导出的报价旧数据', filteredFields)
//
const _mediaTypeArr = currentMediaTypeExport.filter(item => item.type == _mediaType);
console.log('当前类型的报价数据', _mediaTypeArr)
//
if (_mediaTypeArr.length == 0) {
filteredFields.push({ type: _mediaType, exportPriceFields: [] }); // 使 push
exportForm.value.mediaTypeExport = [...filteredFields]; // ref
console.log('更新后的数据', exportForm.value.mediaTypeExport)
}
}
//
const handleChangeType = (_type) => {
activeIndex.value = _type
priceFieldCheckAll.value = false
priceFieldIsIndeterminate.value = false
//
let currentCheckedFields = []
if (ToolOptions.value.length == 8) {
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == _type);
if (curPriceFields.length > 0) {
currentCheckedFields = [...curPriceFields[0].exportPriceFields]
}
}
if (ToolOptions.value.length == 7) {
let wlType = _type + 1
let curPriceFields = exportForm.value.mediaTypeExport.filter(item => item.type == wlType);
if (curPriceFields.length > 0) {
currentCheckedFields = [...curPriceFields[0].exportPriceFields]
}
}
if (ToolOptions.value.length == 8) {
switch (_type) {
case 0:
priceFields.value = ysPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 1:
priceFields.value = mjPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 2:
priceFields.value = hctPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 3:
priceFields.value = dzPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 4:
priceFields.value = dtPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 5:
priceFields.value = gtPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 6:
priceFields.value = xzlPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 7:
priceFields.value = ckdxPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
}
handleCheckPriceField(_type)
}
if (ToolOptions.value.length == 7) {
switch (_type) {
case 0:
priceFields.value = mjPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 1:
priceFields.value = hctPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 2:
priceFields.value = dzPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 3:
priceFields.value = dtPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 4:
priceFields.value = gtPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 5:
priceFields.value = xzlPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
case 6:
priceFields.value = ckdxPriceFild.value
checkedPriceFields.value = []
checkedPriceFields.value = currentCheckedFields
break;
}
let wlType = _type + 1
console.log('网络类型', wlType)
handleCheckPriceField(wlType)
}
//
checkPriceFieldSelectStatus()
}
//
const checkPriceFieldSelectStatus = () => {
const checkedCount = checkedPriceFields.value.length
const totalCount = priceFields.value.length
priceFieldCheckAll.value = checkedCount === totalCount
priceFieldIsIndeterminate.value = checkedCount > 0 && checkedCount < totalCount
}
//
const checkBaseFieldSelectStatus = () => {
const checkedCount = checkedBaseFields.value.length
const totalCount = baseFields.value.length
baseFieldCheckAll.value = checkedCount === totalCount
baseFieldIsIndeterminate.value = checkedCount > 0 && checkedCount < totalCount
}
//
const initExportExcel = (_mediaIds, _curDeptIds) => {
@ -1372,6 +1667,10 @@ const initExportExcel = (_mediaIds, _curDeptIds) => {
exportOpen.value = true
getMediaExcelBaseField()
getMediaExcelPriceField()
//
checkBaseFieldSelectStatus()
checkPriceFieldSelectStatus()
}
// \
@ -1381,24 +1680,24 @@ defineExpose({
</script>
<style lang='scss'>
.el-button-group>.el-button {
.exportGroup>.el-button {
float: left;
position: relative;
height: 38px;
border: 1px solid #DFDFDF;
background: #ffffff;
font-family: Microsoft YaHei;
font-weight: 400;
font-size: 18px;
text-align: center;
color: #000000;
height: 30px;
border: 1px solid #9C9C9C;
background: #9c9c9c1a;
}
.el-button-group>.el-button--primary {
background: #1f1f1f;
font-family: Microsoft YaHei;
font-weight: 600;
color: #FFFFFF;
border: 1px solid #1f1f1f;
.exportGroup>.el-button--primary {
background: #1a75e6;
border: 1px solid #1A75E6;
}
.exportGroup .el-button--primary:last-child {
border-left-color: #1A75E6;
}
.exportGroup .el-button--primary:first-child {
border-right-color: #1A75E6;
}
</style>

View File

@ -38,7 +38,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="媒体形式/名称" prop="business_department">
<el-form-item label="供应商/媒体形式/名称" prop="business_department">
{{ detailForm.mediaName }}
</el-form-item>
</el-col>
@ -113,7 +113,7 @@
</el-row>
<div class="splineBar" />
<el-row :gutter="30" class="my_form_row">
<el-col :span="18">
<el-col :span="12">
<el-form-item label="城市" prop="business_department">
<span v-if="detailForm.provinceName">{{ detailForm.provinceName }}</span>
<span v-if="detailForm.cityName">-{{ detailForm.cityName }}</span>
@ -121,7 +121,7 @@
<span v-if="detailForm.townName">-{{ detailForm.townName }}</span>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="12">
<el-form-item label="商圈" prop="business_department">
{{ detailForm.businessDistrictName }}
</el-form-item>

View File

@ -8,7 +8,7 @@
</el-icon>
</div>
</template>
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="160px" class="myInsertForm">
<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" label-width="180px" class="myInsertForm">
<el-collapse class="my-collapse" v-model="activeNames" @change="handleChange">
<el-collapse-item title="业务部门" name="1">
<el-row :gutter="30" class="my_form_row">
@ -31,7 +31,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="媒体形式/名称" prop="mediaName">
<el-form-item label="供应商/媒体形式/名称" prop="mediaName" >
<el-input v-model="ruleForm.mediaName" placeholder="请输入" />
</el-form-item>
</el-col>

View File

@ -197,7 +197,7 @@
<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="right" prop="floorPrice" width="120" />
<el-table-column label="价总" align="right" prop="minPrice" width="120" />
<el-table-column label="价总" align="right" prop="minPrice" width="120" />
<el-table-column label="制作费" align="right" prop="makeFee" width="130" />
<el-table-column label="媒体费总价" align="right" prop="mediaFeeTotalPrice" width="130" />
<el-table-column label="单日覆盖人流量" align="center" prop="dailyAvgPeopleFlow" width="150" />

View File

@ -45,7 +45,7 @@ const rules = ref({
function submit() {
proxy.$refs.pwdRef.validate(valid => {
if (valid) {
updateUserPwd(user.oldPassword, user.newPassword, user.confirmPassword).then(response => {
updateUserPwd(user.oldPassword, user.newPassword).then(response => {
proxy.$modal.msgSuccess("修改成功")
})
}