Просмотр исходного кода

1 添加我的企业相关接口

2 修复认领企业弹框关闭后无法重新打开的问题
master
王饶冀 3 лет назад
Родитель
Сommit
7ddce5d3ab

+ 26
- 18976
digital-park-web/digital-park/package-lock.json
Разница между файлами не показана из-за своего большого размера
Просмотреть файл


+ 8
- 0
digital-park-web/digital-park/src/api/my-related/index.js Просмотреть файл

/**
* api-我的 相关接口
*/
import { get, post } from "@/utils/http";


// 我的消息
export const getMessageNoticeList = p => get("/messageNotice/getMessageNoticeList", p);

+ 1
- 0
digital-park-web/digital-park/src/main.js Просмотреть файл



// 克隆对象 方便克隆以及调试 // 克隆对象 方便克隆以及调试
Vue.prototype.$cloneDeep = data => JSON.parse(JSON.stringify(data)); Vue.prototype.$cloneDeep = data => JSON.parse(JSON.stringify(data));

new Vue({ new Vue({
router, router,
store, store,

+ 12
- 1
digital-park-web/digital-park/src/router/index.js Просмотреть файл

import Vue from "vue"; import Vue from "vue";
import VueRouter from "vue-router"; import VueRouter from "vue-router";
import hhr from "./hhr"; import hhr from "./hhr";
import store from "../store/index";
Vue.use(VueRouter); Vue.use(VueRouter);


const routes = [...hhr]; const routes = [...hhr];
}); });


router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
// 登录信息
const currentAccount = store.getters.currentAccount;
/* 路由发生变化修改页面title */ /* 路由发生变化修改页面title */
if (to.meta.title) { if (to.meta.title) {
document.title = 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; const originalPush = VueRouter.prototype.push;

+ 9
- 6
digital-park-web/digital-park/src/router/modules/my-related.js Просмотреть файл

* *
*/ */


export default [
// 我的企业
{
export default [
// 我的企业
{
path: "/my-business", path: "/my-business",
name: "MyBusiness", name: "MyBusiness",
component: () => component: () =>
import ("../../views/my-related/business/Business.vue"),
import("../../views/my-related/business/Business.vue"),
meta: { meta: {
title: "我的企业", title: "我的企业",
needLogin: true
}, },
}, },
// 我的消息 // 我的消息
path: "/my-message", path: "/my-message",
name: "MyMessage", name: "MyMessage",
component: () => component: () =>
import ("../../views/my-related/mseeage/Message.vue"),
import("../../views/my-related/mseeage/Message.vue"),
meta: { meta: {
title: "我的消息", title: "我的消息",
needLogin: true
}, },
}, },
// 税收查询 // 税收查询
path: "/tax-inquiry", path: "/tax-inquiry",
name: "TaxInquiry", name: "TaxInquiry",
component: () => component: () =>
import ("../../views/my-related/tax-inquiry/TaxInquiry.vue"),
import("../../views/my-related/tax-inquiry/TaxInquiry.vue"),
meta: { meta: {
title: "税收查询", title: "税收查询",
needLogin: true
}, },
}, },
]; ];

+ 5
- 3
digital-park-web/digital-park/src/views/login/LoginFrom/LoginFrom.vue Просмотреть файл

.then((res) => { .then((res) => {
const data = res.data; const data = res.data;
if (data.status == 0) { if (data.status == 0) {
sendMsg(1, "登录成功");
// 保存用户名 // 保存用户名
setCookie("accountName", accountName.trim()); setCookie("accountName", accountName.trim());
// 判断是否勾选记住密码 // 判断是否勾选记住密码
delCookie("password"); delCookie("password");
} }
this.loginSuccessFn(); this.loginSuccessFn();
sendMsg(1, "登录成功");
} else { } else {
sendMsg(0, data.msg); sendMsg(0, data.msg);
} }
// 登录成功后的响应 // 登录成功后的响应
loginSuccessFn() { loginSuccessFn() {
let getLoginFrom = localStorage.getItem("loginFrom") || "/"; let getLoginFrom = localStorage.getItem("loginFrom") || "/";
this.$router.push(getLoginFrom);
this.$store.dispatch('getUserInfo');
this.$store.dispatch('getUserInfo').then(()=>{
this.$router.push(getLoginFrom);
})
}, },
// 检测是否通过 // 检测是否通过
checkIsAllow(checkKeyList) { checkIsAllow(checkKeyList) {

+ 22
- 1
digital-park-web/digital-park/src/views/my-related/business/Business.scss Просмотреть файл

margin: 0 auto; margin: 0 auto;
.company-name { .company-name {
line-height: 110px; line-height: 110px;
height: 110px;
.company-span { .company-span {
@include font(24px, #fff); @include font(24px, #fff);
font-weight: bold; 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 { .company-btn {
@include font(16px, #fff); @include font(16px, #fff);
.btn-span { .btn-span {
font-size: 16px; font-size: 16px;
} }
.more-icon { .more-icon {
margin-top: 8px;
margin-top: 6px;
cursor: pointer; cursor: pointer;
z-index: 1;
} }
} }
.msg-list { .msg-list {
} }
} }
} }
.el-loading-spinner {
top: 35vh;
}
} }

+ 68
- 8
digital-park-web/digital-park/src/views/my-related/business/Business.vue Просмотреть файл

<template> <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}"> <div class="business-header" :class="{'is-claimed':isClaimed}">
<Nav /> <Nav />
<div class="header-container"> <div class="header-container">
<div class="company-name"> <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"> <div class="company-btn fr" v-if="isClaimed && !isSettleParl">
我是企业,<span class="btn-span">我要入驻园区</span> 我是企业,<span class="btn-span">我要入驻园区</span>
</div> </div>
<!-- 未认领 --> <!-- 未认领 -->
<div class="company-btn fr" v-if="!isClaimed"> <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"> <img src="~@assets/image/myRelated/companyBtnIcon.png" alt="icon">
</div> </div>
</div> </div>
<div class="title"> <div class="title">
<span class="title-span">我的消息</span> <span class="title-span">我的消息</span>
<span class="num-msg">(您有4条未读通知)</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>
<div class="msg-list"> <div class="msg-list">
<div class="msg-list-item" v-for="(item,inx) of myMsgList" :key="inx"> <div class="msg-list-item" v-for="(item,inx) of myMsgList" :key="inx">
<div class="tax-query-box my-message-box"> <div class="tax-query-box my-message-box">
<div class="title"> <div class="title">
<span class="title-span">税收查询</span> <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>
<!-- 没授权 --> <!-- 没授权 -->
<div class="tax-content" v-if="!isAuthorize"> <div class="tax-content" v-if="!isAuthorize">
</div> </div>
</div> </div>
<Footer /> <Footer />
<!-- 认领企业 -->
<ClaimDialog :claimDialog="showClaimDialog" @close="showClaimDialog = false" @updateData="initData"/>
</div> </div>
</template> </template>


import Nav from "@components/Header.vue"; import Nav from "@components/Header.vue";
import Footer from "@components/Footer.vue"; import Footer from "@components/Footer.vue";
import { logout } from '@api/login'; 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 { export default {
components: { Nav, Footer },
components: { Nav, Footer,ClaimDialog },
computed: {
...mapGetters({
currentAccount: "currentAccount",
}),
},
data() { data() {
return { return {
pageLoading:false,
companyDetail:{},
// 是否认领企业 // 是否认领企业
isClaimed: true,
isClaimed: false,
// 认领企业弹框
showClaimDialog: false,
// 是否入驻园区 // 是否入驻园区
isSettleParl: false, isSettleParl: false,
// 公司标签 // 公司标签
], ],
}; };
}, },
mounted(){
this.initData();
},
methods: { 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() { getCompanyName() {
let companyName = "未认领企业"; let companyName = "未认领企业";
}, },
// 退出登录 // 退出登录
logout(){ logout(){
logout().then(()=>{
this.$confirm('确认是否退出登录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
logout().then(()=>{
this.$store.dispatch('getUserInfo').then(()=>{ this.$store.dispatch('getUserInfo').then(()=>{
this.$router.push('/login'); this.$router.push('/login');
this.$message.info("已退出登录")
}) })
}) })
}).catch(() => {});
}, },
}, },
}; };

+ 7
- 0
digital-park-web/digital-park/src/views/my-related/mseeage/Message.scss Просмотреть файл

background: #fff; background: #fff;
padding: 30px; padding: 30px;
color: #334a5f; color: #334a5f;
min-height: calc(100vh - 340px - 100px - 160px);
.table-title { .table-title {
height: 22px; height: 22px;
line-height: 22px; line-height: 22px;
} }
.unread-num { .unread-num {
@include font(16px, #d9121a); @include font(16px, #d9121a);
margin-right: 5px;
} }
.mark-read { .mark-read {
@include font(18px, #0086e7); @include font(18px, #0086e7);
cursor: pointer; cursor: pointer;
margin-left: 10px;
} }
} }
.table-container { .table-container {
position: absolute; position: absolute;
left: 2px; left: 2px;
} }
&.is-read {
border-color: #c0c4cc;
cursor: not-allowed;
}
} }
} }
} }

+ 81
- 5
digital-park-web/digital-park/src/views/my-related/mseeage/Message.vue Просмотреть файл

<img src="~@assets/image/myRelated/titleIcon.png" class="title-icon fl" alt="icon" /> <img src="~@assets/image/myRelated/titleIcon.png" class="title-icon fl" alt="icon" />
<span class="title-span fl">我的消息</span> <span class="title-span fl">我的消息</span>
</div> </div>
<div class="table-box">
<div class="table-box" v-loading="pageLoading">
<div class="table-title"> <div class="table-title">
<span class="title-span fl">我的消息</span> <span class="title-span fl">我的消息</span>
<span class="unread-span"> <span class="unread-span">
(你有 (你有
<span class="unread-num">1172</span>条未读通知) <span class="unread-num">1172</span>条未读通知)
</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>
<div class="table-container"> <div class="table-container">
<el-table class="block-table" :data="tableData" @row-click="openDetail"> <el-table class="block-table" :data="tableData" @row-click="openDetail">
<el-table-column width="34" :align="'center'" class-name="checked-column"> <el-table-column width="34" :align="'center'" class-name="checked-column">
<template slot-scope="scope"> <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 <img
v-if="scope.row.v0" v-if="scope.row.v0"
src="~@assets/image/myRelated/checked.png" src="~@assets/image/myRelated/checked.png"
</el-table> </el-table>
</div> </div>
<div class="pagination_box"> <div class="pagination_box">
<Pagination></Pagination>
<Pagination :currentPage="queryParams.page" :total="queryParams.total" />
</div> </div>
</div> </div>
</div> </div>
import Nav from "@components/Header.vue"; import Nav from "@components/Header.vue";
import Footer from "@components/Footer.vue"; import Footer from "@components/Footer.vue";
import Pagination from "@components/Pagination.vue"; import Pagination from "@components/Pagination.vue";
import { getMessageNoticeList } from "@api/my-related";
import ret from "bluebird/js/release/util";
export default { export default {
components: { Nav, Footer, Pagination }, components: { Nav, Footer, Pagination },
data() { data() {
return { return {
pageLoading: false,
tableColumn: [ tableColumn: [
{ {
label: "通知时间", label: "通知时间",
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)", v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)",
v3: "政策宣传", v3: "政策宣传",
v4: "未读", v4: "未读",
id: 1,
}, },
{ {
v0: true,
v0: false,
v1: "2021.02.09 14:07", v1: "2021.02.09 14:07",
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)", v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)",
v3: "政策宣传", v3: "政策宣传",
v4: "已读",
id: 2,
},
{
v0: false,
v1: "2021.02.09 14:07",
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)",
v3: "政策宣传",
v4: "未读", v4: "未读",
id: 3,
},
{
v0: false,
v1: "2021.02.09 14:07",
v2: "入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)入驻产品审核通过收到入驻产品审核通过收到入驻产品审核通过收到(详情内含有链接)",
v3: "政策宣传",
v4: "未读",
id: 4,
}, },
], ],
detailDialog: { detailDialog: {
msg: "位于市中心国家级高科技产业园~静安多媒体谷近日入驻禾获仁平台,园区是一个以发展新兴科技产业为主,集创意创新、企业孵化、创业服务,创新人才培育、科技成果转化等功能为一体的高科技园区。静安多媒体谷园区注册产品,若您在业务办理方面遇到任何问题,可直接与禾获仁平台在线客服咨询。", msg: "位于市中心国家级高科技产业园~静安多媒体谷近日入驻禾获仁平台,园区是一个以发展新兴科技产业为主,集创意创新、企业孵化、创业服务,创新人才培育、科技成果转化等功能为一体的高科技园区。静安多媒体谷园区注册产品,若您在业务办理方面遇到任何问题,可直接与禾获仁平台在线客服咨询。",
}, },
}, },
queryParams: {
page: 1,
pageSize: 10,
total: 0,
},
checkedList: [],
}; };
}, },
mounted() {
getMessageNoticeList();
},
methods: { 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) { changeCheck(row) {
if (row.v4 == "已读") {
return;
}
// console.log(row.v0);
row.v0 = !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) { openDetail(row) {

+ 1
- 4
digital-park-web/digital-park/src/views/park-enterprises/Detail.vue Просмотреть файл

></other-info> ></other-info>
</section> </section>
<Footer></Footer> <Footer></Footer>
<claim-dialog v-if="showClaimDialog" :claimDialog="claimDialog"></claim-dialog>
<claim-dialog v-if="claimDialog" :claimDialog="claimDialog" @close="claimDialog = false"></claim-dialog>
</div> </div>
</template> </template>


], ],
activeTab: 1, activeTab: 1,
companyInfo: null, companyInfo: null,
showClaimDialog: false,
claimDialog: false, claimDialog: false,
canEdit: 0, canEdit: 0,
isEditing: false, isEditing: false,
if (!this.currentAccount) { if (!this.currentAccount) {
this.$router.push("/login"); this.$router.push("/login");
} }

this.showClaimDialog = true;
this.claimDialog = true; this.claimDialog = true;
}, },
cancelEdit() { cancelEdit() {

+ 8
- 2
digital-park-web/digital-park/src/views/park-enterprises/components/ClaimDialog.vue Просмотреть файл

class="pointer" class="pointer"
src="@assets/image/company/icon_close.png" src="@assets/image/company/icon_close.png"
alt="关闭" alt="关闭"
@click="claimDialog = false"
@click="closeClaimDialog"
/> />
</div> </div>
<div class="dialog_content"> <div class="dialog_content">
this.btnLoading = true; this.btnLoading = true;
addCompanyClaim(this.companyClaimInfo) addCompanyClaim(this.companyClaimInfo)
.then(res => { .then(res => {
console.log(res.data);
console.log(res.data,'认领信息');
if (res.data.status == 0) { if (res.data.status == 0) {
this.companyInfo = res.data.data; this.companyInfo = res.data.data;
this.$emit('updateData')
} else { } else {
this.$message.error(`提交失败,请刷新重试!`); this.$message.error(`提交失败,请刷新重试!`);
} }
}) })
.catch(err => { .catch(err => {
this.$message.error(`提交失败,失败原因${err},请刷新重试!`); this.$message.error(`提交失败,失败原因${err},请刷新重试!`);
this.btnLoading = false;
}); });
}, },
async afterReadUrl(file, imgUrlIndex) { async afterReadUrl(file, imgUrlIndex) {
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`; 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"); window.open(url, "_self");
}, },
// 关闭弹框
closeClaimDialog(){
this.$emit('close');
},
}, },
//生命周期 - 创建完成(可以访问当前this实例) //生命周期 - 创建完成(可以访问当前this实例)
created() {}, created() {},

Загрузка…
Отмена
Сохранить