对接删除

This commit is contained in:
wangchengming 2025-11-14 18:03:57 +08:00
parent abe5979868
commit fb98fffca3
4 changed files with 146 additions and 35 deletions

View File

@ -54,14 +54,118 @@ const exportForm = ref({
const pptFieldCheckAll = ref(false) const pptFieldCheckAll = ref(false)
const pptFieldIsIndeterminate = ref(true) const pptFieldIsIndeterminate = ref(true)
// ppt // ppt
const pptFields = ref([]) const pptFields = ref([
{
displayName: "媒体名称",
propertyPath: "mediaName"
},
{
displayName: "媒体位置",
propertyPath: "address"
},
{
displayName: "纬度",
propertyPath: "mapY"
},
{
displayName: "经度",
propertyPath: "mapX"
},
{
displayName: "媒体类型",
propertyPath: "mediaTypeStr"
},
{
displayName: "媒体大类",
propertyPath: "mediaCategoryStr"
},
{
displayName: "区域属性",
propertyPath: "businessDistrictName"
},
{
displayName: "播放时间",
propertyPath: "playbackTime"
},
{
displayName: "是否照明",
propertyPath: "hasLighting"
},
{
displayName: "展示形式",
propertyPath: "displayFormStr"
},
{
displayName: "媒体尺寸",
propertyPath: "mediaSize"
},
{
displayName: "mr",
propertyPath: "mr"
},
{
displayName: "媒体朝向",
propertyPath: "mediaOrientation"
},
{
displayName: "媒体流量",
propertyPath: "dailyAvgVehicleFlow"
},
{
displayName: "媒体优势",
propertyPath: "advantages"
},
{
displayName: "首次制作安装费",
propertyPath: "firstInstallFee"
},
{
displayName: "换刊制作安装费",
propertyPath: "changeInstallFee"
},
{
displayName: "最小购买周期",
propertyPath: "minPurchaseCycle"
},
{
displayName: "省",
propertyPath: "provinceName"
},
{
displayName: "市",
propertyPath: "cityName"
},
{
displayName: "区",
propertyPath: "areaName"
},
{
displayName: "镇",
propertyPath: "townName"
},
{
displayName: "部门",
propertyPath: "dataScopeDeptName"
},
{
displayName: "状态",
propertyPath: "state"
},
{
displayName: "作废原因",
propertyPath: "invalidReason"
}
])
// ppt // ppt
const checkedPPTFields = ref([]) const checkedPPTFields = ref([])
// //
const handleCloseTag = (tag) => { const handleCloseTag = (tag) => {
const rowIndex = chosedMediaList.value.findIndex(item => item.id == tag.id) const rowIndex = chosedMediaList.value.findIndex(item => item.id == tag.id)
chosedMediaList.value.splice(rowIndex, 1) chosedMediaList.value.splice(rowIndex, 1)
// id // id
exportForm.value.mediaIds = chosedMediaList.value.map(item => item.id); exportForm.value.mediaIds = chosedMediaList.value.map(item => item.id);
} }
@ -85,7 +189,7 @@ const handleCheckedPPTFieldChange = (value) => {
// ppt // ppt
const handleSubmitExportPPT = () => { const handleSubmitExportPPT = () => {
exportForm.value.exportFields = checkedPPTFields exportForm.value.exportFields = checkedPPTFields
exportMediaPPT(exportForm.value).then(res => { exportMediaPPT(exportForm.value).then(res => {
const downLoadName = '媒体信息_' + getCurrentTime() + '.pptx' const downLoadName = '媒体信息_' + getCurrentTime() + '.pptx'
// a // a
@ -114,18 +218,18 @@ const getCurrentTime = () => {
return gettime return gettime
} }
// ppt // // ppt
const getMediaExcelPPTField = () => { // const getMediaExcelPPTField = () => {
mediaPPTField().then(res => { // mediaPPTField().then(res => {
pptFields.value = res.data // pptFields.value = res.data
}) // })
} // }
// //
const initExportPPT = (_tempId, _mediaIds, multipleChoseArr) => { const initExportPPT = (_tempId, _mediaIds, multipleChoseArr) => {
exportForm.value.templateId = _tempId exportForm.value.templateId = _tempId
exportForm.value.mediaIds = _mediaIds exportForm.value.mediaIds = _mediaIds
chosedMediaList.value = JSON.parse(JSON.stringify(multipleChoseArr)) chosedMediaList.value = JSON.parse(JSON.stringify(multipleChoseArr))
getMediaExcelPPTField() // getMediaExcelPPTField()
exportOpen.value = true exportOpen.value = true
} }

View File

@ -186,7 +186,7 @@
<template #reference> <template #reference>
<span class="mediaNameLabel" @click="handleOpenDetail(scope.row)">{{ <span class="mediaNameLabel" @click="handleOpenDetail(scope.row)">{{
scope.row.mediaName scope.row.mediaName
}}</span> }}</span>
</template> </template>
</el-popover> </el-popover>
@ -246,6 +246,8 @@
v-hasPermi="['mediaLibrary:historicalData']">历史数据</div> v-hasPermi="['mediaLibrary:historicalData']">历史数据</div>
<div class="popBtns" @click="handleAbolish(scope.row)" <div class="popBtns" @click="handleAbolish(scope.row)"
v-hasPermi="['mediaLibrary:abolish']">废除</div> v-hasPermi="['mediaLibrary:abolish']">废除</div>
<div class="popBtns" @click="handleDelete(scope.row)"
v-hasPermi="['mediaLibrary:delete']">删除</div>
<div class="popBtns" @click="handleLogs(scope.row)" v-hasPermi="['mediaLibrary:log']">日志 <div class="popBtns" @click="handleLogs(scope.row)" v-hasPermi="['mediaLibrary:log']">日志
</div> </div>
<div class="popBtns" @click="handleDownFiles(scope.row)" <div class="popBtns" @click="handleDownFiles(scope.row)"
@ -273,7 +275,7 @@
<view-file-dialog ref="viewFileRef" /> <view-file-dialog ref="viewFileRef" />
<export-dialog ref="exportDialogRef" /> <export-dialog ref="exportDialogRef" />
<export-p-p-t-dialog ref="exportPPTDialogRef" /> <export-p-p-t-dialog ref="exportPPTDialogRef" />
<importPrice ref="importPriceRef" @handleReloadList="handleQuery"/> <importPrice ref="importPriceRef" @handleReloadList="handleQuery" />
<down-records ref="downRecordsRef" /> <down-records ref="downRecordsRef" />
</div> </div>
</template> </template>
@ -291,7 +293,7 @@ import { listBusSupplier } from "@/api/supplier"
import { sysRegionListByPid } from "@/api/system/administrativeRegion" import { sysRegionListByPid } from "@/api/system/administrativeRegion"
import { sysMediaTypeListByPid } from "@/api/system/mediaType" import { sysMediaTypeListByPid } from "@/api/system/mediaType"
import { busTradingAreaPage } from "@/api/system/businessArea" import { busTradingAreaPage } from "@/api/system/businessArea"
import { mediaPageList } from "@/api/mediaLibrary" import { mediaPageList, deleteMedia } from "@/api/mediaLibrary"
import { listDept } from "@/api/system/dept" import { listDept } from "@/api/system/dept"
import { pptTemplatePage } from "@/api/system/pptTemplate" import { pptTemplatePage } from "@/api/system/pptTemplate"
import { busDownloadRecordPage } from "@/api/mediaDownRecord" import { busDownloadRecordPage } from "@/api/mediaDownRecord"
@ -541,7 +543,7 @@ const handleSelectionChange = (selection) => {
if (isSettingSelection.value) { if (isSettingSelection.value) {
return return
} }
// ID // ID
const currentPageIds = mediaList.value.map(item => item.id) const currentPageIds = mediaList.value.map(item => item.id)
@ -553,7 +555,7 @@ const handleSelectionChange = (selection) => {
) )
// selection // selection
if (shouldHaveSelections) { if (shouldHaveSelections) {
return return
} }
} }
@ -569,7 +571,7 @@ const handleSelectionChange = (selection) => {
if (!multipleChoseArr.value.some(item => item.id === newItem.id)) { if (!multipleChoseArr.value.some(item => item.id === newItem.id)) {
multipleChoseArr.value.push(newItem) multipleChoseArr.value.push(newItem)
} }
}) })
} }
// - // -
const setTableSelection = () => { const setTableSelection = () => {
@ -635,6 +637,15 @@ const handleUpdate = (row) => {
mediaFormRef.value.initForm('编辑媒体信息', row) mediaFormRef.value.initForm('编辑媒体信息', row)
}) })
} }
//
const handleDelete = (row) => {
proxy.$modal.confirm('是否确认删除名称为"' + row.mediaName + '"的媒体数据?').then(function () {
return deleteMedia({ mediaId: row.id })
}).then(() => {
getMediaPageList()
proxy.$modal.msgSuccess("删除成功")
}).catch(() => { })
}
// //
const handleOpenDetail = (row) => { const handleOpenDetail = (row) => {
showDetail.value = true showDetail.value = true

View File

@ -74,7 +74,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="日均车流量" prop="business_department"> <el-form-item label="媒体流量" prop="business_department">
{{ detailForm.dailyAvgVehicleFlow }} {{ detailForm.dailyAvgVehicleFlow }}
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -122,7 +122,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商圈" prop="business_department"> <el-form-item label="区域属性" prop="business_department">
{{ detailForm.businessDistrictName }} {{ detailForm.businessDistrictName }}
</el-form-item> </el-form-item>
</el-col> </el-col>

View File

@ -116,12 +116,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="日均车流量"> <el-form-item label="媒体流量">
<el-input v-model="ruleForm.dailyAvgVehicleFlow" placeholder="请输入"> <el-input v-model="ruleForm.dailyAvgVehicleFlow" placeholder="请输入"></el-input>
<template #suffix>
<span>/</span>
</template>
</el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -173,7 +169,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="商圈" prop="businessDistrictId"> <el-form-item label="区域属性" prop="businessDistrictId">
<el-select v-model="ruleForm.businessDistrictId" placeholder="请选择" <el-select v-model="ruleForm.businessDistrictId" placeholder="请选择"
@change="handleChosebusiness" clearable style="min-width: 30px;"> @change="handleChosebusiness" clearable style="min-width: 30px;">
<el-option v-for="item in businessAreaList" :key="item.id" :label="item.name" <el-option v-for="item in businessAreaList" :key="item.id" :label="item.name"
@ -182,11 +178,11 @@
<div class="select-footer"> <div class="select-footer">
<el-button v-if="!isAdding" @click="onAddOption" type="primary" text <el-button v-if="!isAdding" @click="onAddOption" type="primary" text
style="justify-content: flex-start; width: 100%; color: #1a75e6;"> style="justify-content: flex-start; width: 100%; color: #1a75e6;">
添加商圈 添加区域属性
</el-button> </el-button>
<template v-else> <template v-else>
<el-input v-model="optionName" class="option-input" <el-input v-model="optionName" class="option-input"
placeholder="请输入商圈名称" /> placeholder="请输入区域属性名称" />
<div class="footer-buttons"> <div class="footer-buttons">
<el-button class="my-confirm-btn" type="primary" <el-button class="my-confirm-btn" type="primary"
@click="onConfirm">确认</el-button> @click="onConfirm">确认</el-button>
@ -632,7 +628,7 @@ const journalCataloguePhotoRef = ref(null)
// MR // MR
const mRProductionRequirementsRef = ref(null) const mRProductionRequirementsRef = ref(null)
// //
const isAdding = ref(false) const isAdding = ref(false)
const optionName = ref('') const optionName = ref('')
// //
@ -653,7 +649,7 @@ const deptList = ref([])
// //
const supplierList = ref([]) const supplierList = ref([])
const selectLoading = ref(false) const selectLoading = ref(false)
// //
const businessAreaList = ref([]) const businessAreaList = ref([])
// //
const hasReformList = ref([ const hasReformList = ref([
@ -673,7 +669,7 @@ const data = reactive({
mediaSize: [{ required: true, message: "媒体尺寸不能为空", trigger: "blur" }], mediaSize: [{ required: true, message: "媒体尺寸不能为空", trigger: "blur" }],
mediaOrientation: [{ required: true, message: "媒体朝向不能为空", trigger: "blur" }], mediaOrientation: [{ required: true, message: "媒体朝向不能为空", trigger: "blur" }],
mediaCity: [{ required: true, message: "城市不能为空", trigger: "change" }], mediaCity: [{ required: true, message: "城市不能为空", trigger: "change" }],
businessDistrictId: [{ required: true, message: "商圈不能为空", trigger: "change" }], businessDistrictId: [{ required: true, message: "区域属性不能为空", trigger: "change" }],
firstInstallFee: [{ required: true, message: "首次制作安装费不能为空", trigger: "blur" }], firstInstallFee: [{ required: true, message: "首次制作安装费不能为空", trigger: "blur" }],
changeInstallFee: [{ required: true, message: "换刊制作安装费不能为空", trigger: "blur" }], changeInstallFee: [{ required: true, message: "换刊制作安装费不能为空", trigger: "blur" }],
}, },
@ -734,16 +730,16 @@ const handleChangeDept = (val) => {
if (mRProductionRequirementsRef.value) mRProductionRequirementsRef.value._fileType = 12; if (mRProductionRequirementsRef.value) mRProductionRequirementsRef.value._fileType = 12;
}) })
} }
// //
const handleChosebusiness = (val) => { const handleChosebusiness = (val) => {
const choseBusiness = businessAreaList.value.filter(item => item.id == val)[0] const choseBusiness = businessAreaList.value.filter(item => item.id == val)[0]
ruleForm.value.businessDistrictName = choseBusiness?.name ruleForm.value.businessDistrictName = choseBusiness?.name
} }
// //
const onAddOption = () => { const onAddOption = () => {
isAdding.value = true isAdding.value = true
} }
// //
const onConfirm = () => { const onConfirm = () => {
if (optionName.value) { if (optionName.value) {
const paramsForm = { const paramsForm = {
@ -759,7 +755,7 @@ const onConfirm = () => {
}) })
} }
} }
// //
const clear = () => { const clear = () => {
optionName.value = '' optionName.value = ''
isAdding.value = false isAdding.value = false
@ -940,7 +936,7 @@ const getTownList2 = (value) => {
town.value = res.data town.value = res.data
}) })
} }
// //
const getbusinessAreaList = (val) => { const getbusinessAreaList = (val) => {
const _params = { const _params = {
pageIndex: 1, pageIndex: 1,