@@ -0,0 +1,8 @@ | |||
/** | |||
* api-我的 相关接口 | |||
*/ | |||
import { get, post } from "@/utils/http"; | |||
// 我的消息 | |||
export const getMessageNoticeList = p => get("/messageNotice/getMessageNoticeList", p); |
@@ -30,6 +30,7 @@ Vue.use(ElementUI); | |||
// 克隆对象 方便克隆以及调试 | |||
Vue.prototype.$cloneDeep = data => JSON.parse(JSON.stringify(data)); | |||
new Vue({ | |||
router, | |||
store, |
@@ -1,6 +1,7 @@ | |||
import Vue from "vue"; | |||
import VueRouter from "vue-router"; | |||
import hhr from "./hhr"; | |||
import store from "../store/index"; | |||
Vue.use(VueRouter); | |||
const routes = [...hhr]; | |||
@@ -12,11 +13,21 @@ const router = new VueRouter({ | |||
}); | |||
router.beforeEach((to, from, next) => { | |||
// 登录信息 | |||
const currentAccount = store.getters.currentAccount; | |||
/* 路由发生变化修改页面title */ | |||
if (to.meta.title) { | |||
document.title = to.meta.title; | |||
} | |||
next(); | |||
// 如果该路由需要登录验证 | |||
if (to.meta.needLogin && !currentAccount) { | |||
localStorage.setItem('loginFrom',to.path); | |||
next({ path: '/login' }) | |||
} else { | |||
next(); | |||
} | |||
}); | |||
const originalPush = VueRouter.prototype.push; |
@@ -4,15 +4,16 @@ | |||
* | |||
*/ | |||
export default [ | |||
// 我的企业 | |||
{ | |||
export default [ | |||
// 我的企业 | |||
{ | |||
path: "/my-business", | |||
name: "MyBusiness", | |||
component: () => | |||
import ("../../views/my-related/business/Business.vue"), | |||
import("../../views/my-related/business/Business.vue"), | |||
meta: { | |||
title: "我的企业", | |||
needLogin: true | |||
}, | |||
}, | |||
// 我的消息 | |||
@@ -20,9 +21,10 @@ | |||
path: "/my-message", | |||
name: "MyMessage", | |||
component: () => | |||
import ("../../views/my-related/mseeage/Message.vue"), | |||
import("../../views/my-related/mseeage/Message.vue"), | |||
meta: { | |||
title: "我的消息", | |||
needLogin: true | |||
}, | |||
}, | |||
// 税收查询 | |||
@@ -30,9 +32,10 @@ | |||
path: "/tax-inquiry", | |||
name: "TaxInquiry", | |||
component: () => | |||
import ("../../views/my-related/tax-inquiry/TaxInquiry.vue"), | |||
import("../../views/my-related/tax-inquiry/TaxInquiry.vue"), | |||
meta: { | |||
title: "税收查询", | |||
needLogin: true | |||
}, | |||
}, | |||
]; |
@@ -538,7 +538,7 @@ export default { | |||
.then((res) => { | |||
const data = res.data; | |||
if (data.status == 0) { | |||
sendMsg(1, "登录成功"); | |||
// 保存用户名 | |||
setCookie("accountName", accountName.trim()); | |||
// 判断是否勾选记住密码 | |||
@@ -552,6 +552,7 @@ export default { | |||
delCookie("password"); | |||
} | |||
this.loginSuccessFn(); | |||
sendMsg(1, "登录成功"); | |||
} else { | |||
sendMsg(0, data.msg); | |||
} | |||
@@ -566,8 +567,9 @@ export default { | |||
// 登录成功后的响应 | |||
loginSuccessFn() { | |||
let getLoginFrom = localStorage.getItem("loginFrom") || "/"; | |||
this.$router.push(getLoginFrom); | |||
this.$store.dispatch('getUserInfo'); | |||
this.$store.dispatch('getUserInfo').then(()=>{ | |||
this.$router.push(getLoginFrom); | |||
}) | |||
}, | |||
// 检测是否通过 | |||
checkIsAllow(checkKeyList) { |
@@ -14,10 +14,27 @@ | |||
margin: 0 auto; | |||
.company-name { | |||
line-height: 110px; | |||
height: 110px; | |||
.company-span { | |||
@include font(24px, #fff); | |||
font-weight: bold; | |||
} | |||
.logout { | |||
@include font(16px, #fff); | |||
height: 20px; | |||
line-height: 20px; | |||
// box-sizing: border-box; | |||
padding: 5px 10px; | |||
background-image: linear-gradient( | |||
135deg, | |||
#8592a2 0%, | |||
#728398 100% | |||
); | |||
border-radius: 15px; | |||
margin-top: 40px; | |||
margin-left: 20px; | |||
cursor: pointer; | |||
} | |||
.company-btn { | |||
@include font(16px, #fff); | |||
.btn-span { | |||
@@ -134,8 +151,9 @@ | |||
font-size: 16px; | |||
} | |||
.more-icon { | |||
margin-top: 8px; | |||
margin-top: 6px; | |||
cursor: pointer; | |||
z-index: 1; | |||
} | |||
} | |||
.msg-list { | |||
@@ -241,4 +259,7 @@ | |||
} | |||
} | |||
} | |||
.el-loading-spinner { | |||
top: 35vh; | |||
} | |||
} |
@@ -1,10 +1,13 @@ | |||
<template> | |||
<div class="business" data-1664518006392> | |||
<div class="business" data-1664518006392 v-loading="pageLoading" element-loading-text="数据加载中..."> | |||
<div class="business-header" :class="{'is-claimed':isClaimed}"> | |||
<Nav /> | |||
<div class="header-container"> | |||
<div class="company-name"> | |||
<span class="company-span">公司名称:{{ getCompanyName() }} <button @click="logout">(测试)退出登录</button></span> | |||
<div class="company-span fl"> | |||
用户名:{{ currentAccount ? currentAccount.accountName : ''}} | |||
</div> | |||
<span class="logout fl" @click="logout">退出登录</span> | |||
<!-- 已认领,未入驻园区 --> | |||
<div class="company-btn fr" v-if="isClaimed && !isSettleParl"> | |||
我是企业,<span class="btn-span">我要入驻园区</span> | |||
@@ -12,7 +15,7 @@ | |||
</div> | |||
<!-- 未认领 --> | |||
<div class="company-btn fr" v-if="!isClaimed"> | |||
<span class="btn-span">认领企业</span> | |||
<span class="btn-span" @click="showClaimDialog = true">认领企业</span> | |||
<img src="~@assets/image/myRelated/companyBtnIcon.png" alt="icon"> | |||
</div> | |||
</div> | |||
@@ -52,7 +55,9 @@ | |||
<div class="title"> | |||
<span class="title-span">我的消息</span> | |||
<span class="num-msg">(您有4条未读通知)</span> | |||
<img class="more-icon fr" src="~@assets/image/index/icon_more.png" alt="more" /> | |||
<div class="more-icon fr" @click="goPath('/my-message')"> | |||
<img src="~@assets/image/index/icon_more.png" alt="more" /> | |||
</div> | |||
</div> | |||
<div class="msg-list"> | |||
<div class="msg-list-item" v-for="(item,inx) of myMsgList" :key="inx"> | |||
@@ -65,7 +70,9 @@ | |||
<div class="tax-query-box my-message-box"> | |||
<div class="title"> | |||
<span class="title-span">税收查询</span> | |||
<img class="more-icon fr" src="~@assets/image/index/icon_more.png" alt="more" /> | |||
<div class="more-icon fr" @click="goPath('/tax-inquiry')"> | |||
<img src="~@assets/image/index/icon_more.png" alt="more" /> | |||
</div> | |||
</div> | |||
<!-- 没授权 --> | |||
<div class="tax-content" v-if="!isAuthorize"> | |||
@@ -102,6 +109,8 @@ | |||
</div> | |||
</div> | |||
<Footer /> | |||
<!-- 认领企业 --> | |||
<ClaimDialog :claimDialog="showClaimDialog" @close="showClaimDialog = false" @updateData="initData"/> | |||
</div> | |||
</template> | |||
@@ -110,12 +119,25 @@ import "./Business.scss"; | |||
import Nav from "@components/Header.vue"; | |||
import Footer from "@components/Footer.vue"; | |||
import { logout } from '@api/login'; | |||
import { getCompanyById } from '@api/company'; | |||
import { routerOpenInNewWindow } from "@/utils/common.js"; | |||
import { mapGetters } from "vuex"; | |||
import ClaimDialog from "@/views/park-enterprises/components/ClaimDialog.vue"; | |||
export default { | |||
components: { Nav, Footer }, | |||
components: { Nav, Footer,ClaimDialog }, | |||
computed: { | |||
...mapGetters({ | |||
currentAccount: "currentAccount", | |||
}), | |||
}, | |||
data() { | |||
return { | |||
pageLoading:false, | |||
companyDetail:{}, | |||
// 是否认领企业 | |||
isClaimed: true, | |||
isClaimed: false, | |||
// 认领企业弹框 | |||
showClaimDialog: false, | |||
// 是否入驻园区 | |||
isSettleParl: false, | |||
// 公司标签 | |||
@@ -244,7 +266,37 @@ export default { | |||
], | |||
}; | |||
}, | |||
mounted(){ | |||
this.initData(); | |||
}, | |||
methods: { | |||
// 初始化加载数据 | |||
initData(){ | |||
console.log(this.$cloneDeep(this.currentAccount),'登录信息'); | |||
this.pageLoading = true; | |||
Promise.all([ | |||
// 获取企业信息 | |||
this.getCompanyById() | |||
]).then(()=>{ | |||
this.pageLoading = false; | |||
}) | |||
}, | |||
// 获取企业信息 | |||
getCompanyById(){ | |||
return new Promise(async (resolve, reject) => { | |||
let companyRes = await getCompanyById({companyId:this.currentAccount.accountId}); | |||
this.companyDetail = companyRes.data.data; | |||
this.isClaimed = this.companyDetail.claimState; | |||
resolve(); | |||
}) | |||
}, | |||
// 跳转路由 | |||
goPath(path){ | |||
console.log(1); | |||
routerOpenInNewWindow({ | |||
path, | |||
}); | |||
}, | |||
// 获取公司名称 | |||
getCompanyName() { | |||
let companyName = "未认领企业"; | |||
@@ -256,11 +308,19 @@ export default { | |||
}, | |||
// 退出登录 | |||
logout(){ | |||
logout().then(()=>{ | |||
this.$confirm('确认是否退出登录', '提示', { | |||
confirmButtonText: '确定', | |||
cancelButtonText: '取消', | |||
type: 'warning' | |||
}).then(() => { | |||
logout().then(()=>{ | |||
this.$store.dispatch('getUserInfo').then(()=>{ | |||
this.$router.push('/login'); | |||
this.$message.info("已退出登录") | |||
}) | |||
}) | |||
}).catch(() => {}); | |||
}, | |||
}, | |||
}; |
@@ -24,6 +24,7 @@ | |||
background: #fff; | |||
padding: 30px; | |||
color: #334a5f; | |||
min-height: calc(100vh - 340px - 100px - 160px); | |||
.table-title { | |||
height: 22px; | |||
line-height: 22px; | |||
@@ -34,10 +35,12 @@ | |||
} | |||
.unread-num { | |||
@include font(16px, #d9121a); | |||
margin-right: 5px; | |||
} | |||
.mark-read { | |||
@include font(18px, #0086e7); | |||
cursor: pointer; | |||
margin-left: 10px; | |||
} | |||
} | |||
.table-container { | |||
@@ -80,6 +83,10 @@ | |||
position: absolute; | |||
left: 2px; | |||
} | |||
&.is-read { | |||
border-color: #c0c4cc; | |||
cursor: not-allowed; | |||
} | |||
} | |||
} | |||
} |
@@ -8,20 +8,25 @@ | |||
<img src="~@assets/image/myRelated/titleIcon.png" class="title-icon fl" alt="icon" /> | |||
<span class="title-span fl">我的消息</span> | |||
</div> | |||
<div class="table-box"> | |||
<div class="table-box" v-loading="pageLoading"> | |||
<div class="table-title"> | |||
<span class="title-span fl">我的消息</span> | |||
<span class="unread-span"> | |||
(你有 | |||
<span class="unread-num">1172</span>条未读通知) | |||
</span> | |||
<span class="mark-read fr">全部标记已读</span> | |||
<span class="mark-read fr" @click="markRead('all')">全部标记已读</span> | |||
<span class="mark-read fr" @click="markRead('check')">勾选标记已读</span> | |||
</div> | |||
<div class="table-container"> | |||
<el-table class="block-table" :data="tableData" @row-click="openDetail"> | |||
<el-table-column width="34" :align="'center'" class-name="checked-column"> | |||
<template slot-scope="scope"> | |||
<span class="check-span" @click.stop="changeCheck(scope.row)"> | |||
<span | |||
class="check-span" | |||
:class="{'is-read' : scope.row.v4 == '已读'}" | |||
@click.stop="changeCheck(scope.row)" | |||
> | |||
<img | |||
v-if="scope.row.v0" | |||
src="~@assets/image/myRelated/checked.png" | |||
@@ -42,7 +47,7 @@ | |||
</el-table> | |||
</div> | |||
<div class="pagination_box"> | |||
<Pagination></Pagination> | |||
<Pagination :currentPage="queryParams.page" :total="queryParams.total" /> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -70,10 +75,13 @@ import "./Message.scss"; | |||
import Nav from "@components/Header.vue"; | |||
import Footer from "@components/Footer.vue"; | |||
import Pagination from "@components/Pagination.vue"; | |||
import { getMessageNoticeList } from "@api/my-related"; | |||
import ret from "bluebird/js/release/util"; | |||
export default { | |||
components: { Nav, Footer, Pagination }, | |||
data() { | |||
return { | |||
pageLoading: false, | |||
tableColumn: [ | |||
{ | |||
label: "通知时间", | |||
@@ -102,13 +110,31 @@ export default { | |||
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)", | |||
v3: "政策宣传", | |||
v4: "未读", | |||
id: 1, | |||
}, | |||
{ | |||
v0: true, | |||
v0: false, | |||
v1: "2021.02.09 14:07", | |||
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)", | |||
v3: "政策宣传", | |||
v4: "已读", | |||
id: 2, | |||
}, | |||
{ | |||
v0: false, | |||
v1: "2021.02.09 14:07", | |||
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)", | |||
v3: "政策宣传", | |||
v4: "未读", | |||
id: 3, | |||
}, | |||
{ | |||
v0: false, | |||
v1: "2021.02.09 14:07", | |||
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)", | |||
v3: "政策宣传", | |||
v4: "未读", | |||
id: 4, | |||
}, | |||
], | |||
detailDialog: { | |||
@@ -117,12 +143,62 @@ export default { | |||
msg: "位于市中心国家级高科技产业园~静安多媒体谷近日入驻禾获仁平台,园区是一个以发展新兴科技产业为主,集创意创新、企业孵化、创业服务,创新人才培育、科技成果转化等功能为一体的高科技园区。静安多媒体谷园区注册产品,若您在业务办理方面遇到任何问题,可直接与禾获仁平台在线客服咨询。", | |||
}, | |||
}, | |||
queryParams: { | |||
page: 1, | |||
pageSize: 10, | |||
total: 0, | |||
}, | |||
checkedList: [], | |||
}; | |||
}, | |||
mounted() { | |||
getMessageNoticeList(); | |||
}, | |||
methods: { | |||
// 获取列表数据 | |||
async getMessageNoticeList() { | |||
this.pageLoading = true; | |||
let listData = await getMessageNoticeList(this.queryParams()); | |||
this.pageLoading = false; | |||
console.log(listData); | |||
}, | |||
/** | |||
* 标记已读 | |||
* @param {*} target all 全部 check 勾选已读 | |||
*/ | |||
markRead(target) { | |||
let param = {}; | |||
if (target == "all") { | |||
} else { | |||
if(this.checkedList.length < 1){ | |||
return this.$message.error("请至少勾选一条数据"); | |||
}else { | |||
param.idList = this.checkedList; | |||
} | |||
} | |||
// 设置已读 | |||
console.log(this.$cloneDeep(param),'已读传参') | |||
}, | |||
// 单元格点击 | |||
changeCheck(row) { | |||
if (row.v4 == "已读") { | |||
return; | |||
} | |||
// console.log(row.v0); | |||
row.v0 = !row.v0; | |||
// console.log(row.v0); | |||
// 如果已勾选的list里有这个ID,并且此数据为false 需要删除 | |||
if (this.checkedList.includes(row.id) && !row.v0) { | |||
this.checkedList.splice(this.checkedList.indexOf(row.id), 1); | |||
} | |||
// 直接push | |||
else { | |||
this.checkedList.push(row.id); | |||
} | |||
// console.log(this.$cloneDeep(this.checkedList)); | |||
// if(row.v0 && this.checkedList[]){ | |||
// } | |||
}, | |||
// 打开详情弹框 | |||
openDetail(row) { |
@@ -152,7 +152,7 @@ | |||
></other-info> | |||
</section> | |||
<Footer></Footer> | |||
<claim-dialog v-if="showClaimDialog" :claimDialog="claimDialog"></claim-dialog> | |||
<claim-dialog v-if="claimDialog" :claimDialog="claimDialog" @close="claimDialog = false"></claim-dialog> | |||
</div> | |||
</template> | |||
@@ -205,7 +205,6 @@ export default { | |||
], | |||
activeTab: 1, | |||
companyInfo: null, | |||
showClaimDialog: false, | |||
claimDialog: false, | |||
canEdit: 0, | |||
isEditing: false, | |||
@@ -264,8 +263,6 @@ export default { | |||
if (!this.currentAccount) { | |||
this.$router.push("/login"); | |||
} | |||
this.showClaimDialog = true; | |||
this.claimDialog = true; | |||
}, | |||
cancelEdit() { |
@@ -16,7 +16,7 @@ | |||
class="pointer" | |||
src="@assets/image/company/icon_close.png" | |||
alt="关闭" | |||
@click="claimDialog = false" | |||
@click="closeClaimDialog" | |||
/> | |||
</div> | |||
<div class="dialog_content"> | |||
@@ -324,9 +324,10 @@ export default { | |||
this.btnLoading = true; | |||
addCompanyClaim(this.companyClaimInfo) | |||
.then(res => { | |||
console.log(res.data); | |||
console.log(res.data,'认领信息'); | |||
if (res.data.status == 0) { | |||
this.companyInfo = res.data.data; | |||
this.$emit('updateData') | |||
} else { | |||
this.$message.error(`提交失败,请刷新重试!`); | |||
} | |||
@@ -334,6 +335,7 @@ export default { | |||
}) | |||
.catch(err => { | |||
this.$message.error(`提交失败,失败原因${err},请刷新重试!`); | |||
this.btnLoading = false; | |||
}); | |||
}, | |||
async afterReadUrl(file, imgUrlIndex) { | |||
@@ -347,6 +349,10 @@ export default { | |||
let url = `http://192.168.18.236:18888/common/downloadFile?path=/website/public/%E6%8E%88%E6%9D%83%E4%B9%A6.doc&fileName=%E6%8E%88%E6%9D%83%E4%B9%A6.doc`; | |||
window.open(url, "_self"); | |||
}, | |||
// 关闭弹框 | |||
closeClaimDialog(){ | |||
this.$emit('close'); | |||
}, | |||
}, | |||
//生命周期 - 创建完成(可以访问当前this实例) | |||
created() {}, |