Commit aa7927e4 by liudx

联调导出记录、导出、发送邮箱接口

parent 3996c299
......@@ -11,6 +11,10 @@ export const cancelFollow = p => Delete('/api/users/userFollow', p);
export const followList = p => get('/api/users/userFollow?page='+p.page+'&size='+p.size);
//浏览记录
export const userBrowse = p => get('/api/users/userBrowse?page='+p.page+'&size='+p.size);
//用户导出记录
export const ExportList = p => get(' /api/users/enterprisePatentExport?page='+p.page+'&size='+p.size);
//导出记录里的发送邮箱
export const sendEmail = p => post('/api/common/sendEmail', p);
......
......@@ -37,10 +37,10 @@
<span style="cursor: pointer" @click="openModal"
><img src="@/static/patent/icon-dc.png" alt="" />导出</span
>
<span @click="followFun" v-if="!baseinfo.follow"
<span style="cursor: pointer" @click="followFun" v-if="!baseinfo.follow"
><img src="@/static/patent/icon-gz.png" alt="" />关注</span
>
<span @click="cancelFun" v-else
<span style="cursor: pointer" @click="cancelFun" v-else
><img src="@/static/patent/icon-gz-select.png" alt="" />已关注</span
>
</div>
......@@ -1217,7 +1217,7 @@ export default {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
});
//formData文件流
that.blobToBase64(out, that.formState.email,that.baseinfo.company_name);
that.blobToBase64(out, that.formState.email,that.baseinfo.company_name,that.id);
// 将目标文件对象保存为目标类型的文件,并命名
// saveAs(out, `企业科创能力报告.docx`);
}
......@@ -1230,7 +1230,7 @@ export default {
// 处理验证失败的情况
});
},
blobToBase64(blob, email,name) {
blobToBase64(blob, email,name,id) {
return new Promise((resolve, reject) => {
const fileReader = new FileReader();
fileReader.onload = (e) => {
......@@ -1239,7 +1239,8 @@ export default {
report_data: e.target.result,
email: email,
name:name,
f_type:'enterprise'
f_type:'enterprise',
ent_or_pat_id:id
}).then((res) => {
if (res.code == 0) {
message.success(res.msg);
......
......@@ -119,7 +119,7 @@
>条相关结果
<!-- 筛选的标签展示 -->
<div class="filter">
<a-tag color="blue" v-for="item in filter">
<a-tag class="tags" color="blue" v-for="item in filter">
{{ item }}
</a-tag>
</div>
......@@ -133,29 +133,29 @@
@click="openCompany(item.mysql_id, item.company_name)"
>
{{ item.company_name }}
<!-- 关注 -->
<div
class="follow"
@click="followFun(item.mysql_id, item.company_name)"
v-if="!item.follow"
>
<img
src="@/static/company/icon-guanzhu.png"
alt=""
class="follow_img"
/>
<span class="follow_str">关注</span>
</div>
<div class="follow" @click="cancelFun(item.mysql_id)" v-else>
<img
src="@/static/company/icon-yiguanzhu.png"
alt=""
class="follow_img"
/>
<span class="follow_str">已关注</span>
</div>
</div>
<br />
<!-- 关注 -->
<div
class="follow"
@click="followFun(item.mysql_id, item.company_name)"
v-if="!item.follow"
>
<img
src="@/static/company/icon-guanzhu.png"
alt=""
class="follow_img"
/>
<span class="follow_str">关注</span>
</div>
<div class="follow" @click="cancelFun(item.mysql_id)" v-else>
<img
src="@/static/company/icon-yiguanzhu.png"
alt=""
class="follow_img"
/>
<span class="follow_str">已关注</span>
</div>
<a-tag color="#56CA95">{{ item.status }}</a-tag>
<a-tag color="#6096E6" v-if="item.quoted_company == 1">{{
"上市企业"
......@@ -170,7 +170,6 @@
<a-tag color="#6096E6" v-if="item.zjtg == 1">{{
"专精特新中小企业"
}}</a-tag>
<a-divider />
<div class="card_desc">
<a-descriptions layout="vertical">
......@@ -262,7 +261,7 @@ export default {
ent_or_pat_id: id,
});
if (cancelRes.code == 0) {
this.Filter();
this.onChange(this.currentPage);
message.success(cancelRes.msg);
} else {
message.error(cancelRes.msg);
......@@ -278,7 +277,7 @@ export default {
if (Follow.code == 0) {
message.success(Follow.msg);
this.Filter();
this.onChange(this.currentPage);
} else {
message.error(Follow.msg);
}
......@@ -366,6 +365,24 @@ export default {
innovate: this.valueInnovation,
};
//将筛选条件渲染到页面上//搜索结果标签
let filter = [];
this.filter = [];
for (var key in params) {
filter = [
...params.area,
...params.company_industry,
...params.qualification,
// params.innovate,
];
if (key == "keyword") {
params.keyword ? filter.push(params.keyword) : "";
}
if (key == "innovate") {
params.innovate ? filter.push(params.innovate) : "";
}
}
this.filter = filter;
//请求接口
enterpriseSelect({ ...params }).then((res) => {
if (res.code == 0) {
......@@ -446,9 +463,9 @@ export default {
//企业结果
this.companylist = [];
this.currentPage = 1;
let params = {
page: this.currentPage,
page: 1,
size: 10,
keyword: this.keyword ? this.keyword : null,
area: area,
......@@ -484,7 +501,6 @@ export default {
this.filter = filter;
//请求接口
enterpriseSelect({ ...params }).then((res) => {
if (res.code == 0) {
this.companylist = res.data.list;
this.total = res.data.total;
......@@ -550,9 +566,7 @@ export default {
this.formState.capital_nums_max = searchValue.capital_nums_max;
this.valueInnovation = searchValue.valueInnovation;
this.keyword = searchValue.keyword;
this.Filter();
} else {
this.Filter();
this.onChange(this.currentPage);
}
},
};
......@@ -653,40 +667,43 @@ export default {
margin-bottom: 15px;
position: relative;
margin-right: 1%;
:deep(.ant-tag-has-color) {
padding: 5px;
border-radius: 6px;
margin: 10px 5px;
}
.follow {
position: absolute;
right: 30px;
top: 30px;
width: 112px;
height: 32px;
background: #b6b4b4;
background: #b5bdc5;
border-radius: 8px 8px 8px 8px;
opacity: 1;
text-align: center;
line-height: 32px;
cursor: pointer;
.follow_img {
width: 20px;
margin-top: -5px;
}
.follow_str {
padding-left: 8px;
color: #fff;
// color: #f2c25e;
}
}
.card_title {
font-family: Microsoft YaHei UI-Regular, Microsoft YaHei UI;
font-weight: 400;
color: #333333;
font-size: 20px;
cursor: pointer;
display: flex;
justify-content: space-between;
.follow {
width: 112px;
height: 32px;
background: #b6b4b4;
background: #b5bdc5;
border-radius: 8px 8px 8px 8px;
opacity: 1;
text-align: center;
line-height: 32px;
cursor: pointer;
.follow_img {
width: 20px;
margin-top: -5px;
}
.follow_str {
padding-left: 8px;
color: #fff;
// color: #f2c25e;
}
}
}
.card_desc {
:deep(.ant-descriptions-item-label) {
......
......@@ -107,10 +107,12 @@ export default {
if (res.code == 0) {
this.dataHistory = res.data;
this.total = res.total;
this.dataHistory.forEach((item, index) => {
item.index = (this.currentPage-1) * 10 + index+1;
item.follow_time = item.follow_time.replace(/T/g, " ");
});
if (this.dataHistory.length > 0) {
this.dataHistory.forEach((item, index) => {
item.index = (this.currentPage - 1) * 10 + index + 1;
item.follow_time = item.follow_time.replace(/T/g, " ");
});
}
} else {
message.error(res.msg);
}
......@@ -118,7 +120,6 @@ export default {
},
//跳转到专利详情或者公司详情页面
rowClick(record) {
console.log(record)
if (record.f_type == "patent") {
this.$router.push({
path: "/patentDetails",
......@@ -144,14 +145,13 @@ export default {
},
//取消关注
async removeFollow(item) {
console.log(item);
this.visible = false;
let cancelRes = await cancelFollow({
f_type: item.f_type,
ent_or_pat_id: item.ent_or_pat_id,
});
if (cancelRes.code == 0) {
this.$router.go(0);
this.onChange()
message.success(cancelRes.msg);
} else {
message.error(cancelRes.msg);
......@@ -200,14 +200,13 @@ export default {
background-color: #fff;
padding: 20px;
height: 92%;
text-align: center;
}
:deep(.ant-modal-footer) {
text-align: center !important;
}
:deep(.ant-table-tbody){
:deep(.ant-table-tbody) {
cursor: pointer;
}
}
......
......@@ -39,24 +39,31 @@
<p style="text-align: left">系统会为您保留 30 天的导出记录</p>
<a-table
:columns="columnout"
:data-source="dataHistory"
:data-source="dataExport"
:pagination="false"
:style="'width:90%'"
>
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex == 'action'">
<a-button
@click="exportPDF(record)"
style="
background-color: #fa7f03;
color: #fff;
margin-right: 10%;
"
>导出</a-button
>
<a-button type="primary" @click="openModal"
>
导出
</a-button>
<a-button type="primary" @click="sendMail(record)"
>发送到邮箱</a-button
>
</template>
<template v-if="column.dataIndex == 'f_type'">
{{ text == "patent" ? "专利" : "公司" }}
</template>
<template v-if="column.dataIndex == 'name'">
<span @click="rowClick(record)">{{ text }}</span>
</template>
......@@ -71,7 +78,7 @@
</a-tab-pane>
</a-tabs>
</div>
<a-modal
<!-- <a-modal
v-model:visible="visible"
title="发送邮箱"
@ok="sendMail"
......@@ -88,12 +95,13 @@
<a-input v-model:value="formState.email" />
</a-form-item>
</a-form>
</a-modal>
</a-modal> -->
</div>
</template>
<script>
import { message } from "ant-design-vue";
import { userBrowse } from "../../utils/userAPI";
import { userBrowse, ExportList,sendEmail } from "../../utils/userAPI";
export default {
name: "history",
data() {
......@@ -116,19 +124,19 @@ export default {
title: "序号",
dataIndex: "index",
key: "index",
width: 100,
width: 80,
},
{
title: "名称",
dataIndex: "name",
key: "name",
width: 300,
width: 200,
},
{
title: "类型",
dataIndex: "f_type",
key: "f_type",
width: 200,
width: 100,
},
{
title: "时间",
......@@ -140,31 +148,32 @@ export default {
columnout: [
{
title: "序号",
dataIndex: "name",
key: "name",
dataIndex: "index",
key: "index",
width: 100,
},
{
title: "名称",
dataIndex: "age",
key: "age",
dataIndex: "name",
key: "name",
},
{
title: "类型",
dataIndex: "address",
key: "address 1",
width: 200,
dataIndex: "f_type",
key: "f_type",
width: 100,
},
{
title: "接受邮箱",
dataIndex: "address",
key: "address 3",
dataIndex: "email",
key: "email",
width: 200,
},
{
title: "时间",
dataIndex: "address",
key: "address 3",
width: 200,
dataIndex: "export_time",
key: "export_time",
width: 150,
},
{
title: "操作",
......@@ -173,6 +182,7 @@ export default {
},
],
dataHistory: [],
dataExport:[]
};
},
components: {},
......@@ -199,8 +209,18 @@ export default {
}
},
//发送到邮箱
sendMail() {
this.visible = false;
async sendMail(record) {
// this.visible = false;
let res = await sendEmail({
email:record.email,
name:record.name,
url:record.url
})
if(res.code==200){
message.success(res.msg)
}else{
message.error(res.msg)
}
},
//打开弹窗
openModal() {
......@@ -222,14 +242,38 @@ export default {
if (res.code == 0) {
this.dataHistory = res.data.data;
this.total = res.data.total;
this.dataHistory.forEach((item, index) => {
item.index = (this.currentPage-1) * 10 + index+1;
if(this.dataHistory.length>0){
this.dataHistory.forEach((item, index) => {
item.index = (this.currentPage - 1) * 10 + index + 1;
});
}
} else {
message.error(res.msg);
}
});
ExportList({
page: this.currentPage,
size: 10,
}).then((res) => {
if (res.code == 0) {
this.dataExport = res.data.data;
this.total = res.data.total;
if(this.dataExport.length>0){
this.dataExport.forEach((item, index) => {
item.index = (this.currentPage - 1) * 10 + index + 1;
});
}
} else {
message.error(res.msg);
}
});
},
//导出pdf
exportPDF(record){
window.open(record.url)
}
},
created() {
this.init();
......@@ -255,7 +299,7 @@ export default {
text-align: center;
// height: 600px;
}
:deep(.ant-table-tbody){
:deep(.ant-table-tbody) {
cursor: pointer;
}
}
......
......@@ -422,6 +422,9 @@ export default {
line-height: 40px;
color: #555770;
cursor: pointer;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
li::marker {
color: #ccc;
......
......@@ -457,4 +457,7 @@ export default {
}
}
}
:deep(.ant-table-tbody){
cursor: pointer;
}
</style>
......@@ -252,17 +252,17 @@
>
{{ item.company_name }}
</div>
<a-tag color="#56CA95">{{ item.status }}</a-tag>
<a-tag color="#6096E6" v-if="item.quoted_company == 1">{{
<a-tag class="tags" color="#56CA95">{{ item.status }}</a-tag>
<a-tag class="tags" color="#6096E6" v-if="item.quoted_company == 1">{{
"上市挂牌企业"
}}</a-tag>
<a-tag color="#6096E6" v-if="item.high_new == 1">{{
<a-tag class="tags" color="#6096E6" v-if="item.high_new == 1">{{
"高新技术企业"
}}</a-tag>
<a-tag color="#6096E6" v-if="item.zjtg_sjxjr == 1">{{
<a-tag class="tags" color="#6096E6" v-if="item.zjtg_sjxjr == 1">{{
"专精特新小巨人"
}}</a-tag>
<a-tag color="#6096E6" v-if="item.zjtg == 1">{{
<a-tag class="tags" color="#6096E6" v-if="item.zjtg == 1">{{
"专精特新中小企业"
}}</a-tag>
<a-divider />
......@@ -483,9 +483,9 @@ export default {
});
},
//智能推荐翻页
onChange() {
onChange(page) {
window.scrollTo(0, 0);
this.currentPage = 1;
this.currentPage = page;
this.getRecommend();
},
getRecommend() {
......@@ -676,7 +676,7 @@ export default {
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
});
//formData文件流
that.blobToBase64(out, that.formState.email, that.details.gkh);
that.blobToBase64(out, that.formState.email, that.details.gkh,this.id);
// 将目标文件对象保存为目标类型的文件,并命名
// saveAs(out, `专利成果转移转化智能推荐报告.docx`);
that.visible = false;
......@@ -699,7 +699,8 @@ export default {
report_data: e.target.result,
email: email,
name: name,
f_type:'patent'
f_type:'patent',
ent_or_pat_id:id
}).then((res) => {
if (res.code == 0) {
message.success(res.msg);
......@@ -922,6 +923,9 @@ export default {
color: #333333;
font-size: 20px;
}
.tags{
margin: 5px;
}
.card_desc {
:deep(b) {
color: rgba(191, 36, 40, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment