diff --git a/src/api/basicdata/basicdataFreight.js b/src/api/basicdata/basicdataFreight.js index e51447b8..701842f9 100644 --- a/src/api/basicdata/basicdataFreight.js +++ b/src/api/basicdata/basicdataFreight.js @@ -85,4 +85,15 @@ export const $_getDeptLazyTree = params => { method: 'get', params }); -}; \ No newline at end of file +}; + + + + +export const $_basicdataFreight = (row) => { + return request({ + url: '/api/logpm-basicdata/basicdataFreight/import', + method: 'post', + data: row + }) +} \ No newline at end of file diff --git a/src/utils/poptxt.js b/src/utils/poptxt.js new file mode 100644 index 00000000..98023724 --- /dev/null +++ b/src/utils/poptxt.js @@ -0,0 +1,67 @@ +import { ElMessage } from 'element-plus' // 引入 ElMessage 组件 +export function popmsg(res) { + // 显示成功消息 + if (res.msg == '导入成功') { + ElMessage({ + message: res.msg, + type: 'success', + }); + return; + }else{ + + + // 创建包含 p 标签的内容的 div 元素 + var fragment = document.createDocumentFragment(); + var div = document.createElement('div'); + div.id = 'createdDiv'; + var timeout; // 用于设置定时器 + // 设置 div 样式 + div.style.zIndex = '9999'; + div.style.position = 'fixed'; + div.style.fontSize = '16px'; + div.style.top = '50%'; + div.style.left = '50%'; + div.style.transform = 'translate(-50%, -50%)'; + div.style.width = '50%'; + div.style.height = '200px'; + div.style.backgroundColor = '#ffffff'; + div.style.borderRadius = '4px'; + div.style.overflow = 'scroll'; + div.style.border = '1px solid #ccc'; + div.style.padding = '10px'; + // 将后端返回的内容作为 HTML 插入到 div 中 + div.innerHTML = res.msg; + // 遍历所有的

标签并设置首行缩进 + var pTags = div.querySelectorAll('p'); + pTags.forEach(function (pTag) { + pTag.style.textIndent = '2em'; + }); + fragment.appendChild(div); + // 添加鼠标事件监听 + // div.addEventListener('mouseover', function () { + // clearTimeout(timeout); // 清除自动消失的定时器 + // }); + + // div.addEventListener('mouseout', function () { + // timeout = setTimeout(function () { + // div.remove(); // 3 秒后自动消失 + // }, 3000); + // }); + + document.body.appendChild(fragment); + + // 初始化定时器 + // timeout = setTimeout(function () { + // div.remove(); // 自动消失 + // }, 3000); + function closePopupOnClickOutside(event) { + if (div && !div.contains(event.target)) { + div.remove(); // 点击弹窗之外的地方,移除弹窗 + document.removeEventListener('click', closePopupOnClickOutside); // 移除监听器 + } + } + + // 添加点击事件监听 + document.addEventListener('click', closePopupOnClickOutside); + } + } \ No newline at end of file diff --git a/src/views/basicdata/brand/basicdataFreight.vue b/src/views/basicdata/brand/basicdataFreight.vue index c9bb258a..39f68c52 100644 --- a/src/views/basicdata/brand/basicdataFreight.vue +++ b/src/views/basicdata/brand/basicdataFreight.vue @@ -10,6 +10,7 @@ :permission="permissionList" :before-open="beforeOpen" ref="crud" + :upload-after="uploadAfter" @row-update="rowUpdate" @row-save="rowSave" @row-del="rowDel" @@ -38,8 +39,14 @@ @click="handleDelete" >删 除 - 导 入 - + 导入数据 + 下载模板 + - + - + - + - + - + item !== null); // 过滤掉任何未匹配的值(null) console.log(matchedData,'筛选出来的值'); this.form.categoryName = matchedData.map(res=>res.name).join(',') - + console.log(this.sendgoods,'发货单位'); + console.log(this.form.forwardingUnitId,'当前发货单位'); + this.form.name = this.CustomerName.find(res=>res.id==this.form.clientIds).clientName;//客户名称 - this.form.sendgoods=this.sendgoods.find(res=>res.id==this.form.forwarding).clientName;//发货单位名称 + this.form.forwardingUnitName=this.sendgoods.find(res=>res.id==this.form.forwardingUnitId).clientName;//发货单位名称 this.form.brandName= this.brandList.find(res=>res.brandId==this.form.brand).brandName;//品牌名称 this.form.fixedPrice='0' console.log('提交的数据》》》', this.form); + add(this.form).then(() => { this.$store.commit('DEL_TAG_CURRENT'); //关闭当前页面 this.$router.push('/basicdata/brand/basicdataFreight'); //添加成功跳转到列表 @@ -620,6 +649,14 @@ export default { this.buyNow = true; } }, +// // 图片上传必须携带TOKEN +// const headers = computed(() => { +// return { 'Blade-Auth': 'Bearer ' + getToken() }; +// }); +// // 图片上传接口 +// const doubledCount = computed(() => { +// return '/api/blade-resource/oss/endpoint/put-file'; +// }); choiceRide(a) { //一口价选择 console.log(a);