【update】- 打包管理详情页加合计、单点登录区分角色跳转

This commit is contained in:
fengchenchen
2023-08-30 17:49:53 +08:00
parent 0c496c9e8a
commit 2428919e4c
6 changed files with 299 additions and 105 deletions
+4 -1
View File
@@ -29,4 +29,7 @@ window._CONFIG["sendAddress"] = "天津市东丽区先锋东路68号"
window._CONFIG["sendPostCode"] = "300300"
// 查看物流信息-- 在企业端
window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo";
window._CONFIG["lookExpressDomainURL"] = "http://localhost:21826/lookExpressInfo";
// 来款内部部署的ip
window._CONFIG["intranetUrl"] = "http://localhost:21825/";
+4 -1
View File
@@ -31,4 +31,7 @@ window._CONFIG["sendPostCode"] = "300300"
// 查看物流信息
// window._CONFIG["lookExpressDomainURL"] = "http://bxxt.hzwlsoft.com/lookExpressInfo";
window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo";
window._CONFIG["lookExpressDomainURL"] = "http://10.10.10.46:8066/lookExpressInfo";
// 来款内部部署的ip
window._CONFIG["intranetUrl"] = "http://10.10.10.46:8055/";
+4 -1
View File
@@ -26,4 +26,7 @@ window._CONFIG["sendAddress"] = "天津市东丽区先锋东路68号"
window._CONFIG["sendPostCode"] = "300300"
// 查看物流信息
window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookExpressInfo"
window._CONFIG["lookExpressDomainURL"] = "http://cwp.catarc.org.cn/lookExpressInfo"
// 来款内部部署的ip
window._CONFIG["intranetUrl"] = "http://10.12.8.1/";
+3
View File
@@ -4,6 +4,8 @@ import {UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
// idm 系统单点登录 获取用户信息
const loginIdmPlatform = (params) => postAction(`/sys/singleSignOn?code=${params.code}`)
// idm 系统单点登录 通过token获取userInfo
const getUserInfo = (params) => getAction(`/sys/user/getUserInfoByToken`, params)
//角色管理
const addRole = (params)=>postAction('/sys/role/add',params)
const editRole = (params)=>postAction('/sys/role/edit',params)
@@ -195,6 +197,7 @@ export {
getKeyIv,
getContactsByCompanyNoLimit,
loginIdmPlatform,
getUserInfo,
companyAdminResetPassword,
companyAdminEnable,
queryCompanyInfoById
+18 -4
View File
@@ -7,7 +7,7 @@ import 'nprogress/nprogress.css' // progress bar style
import { ACCESS_TOKEN, INDEX_MAIN_PAGE_PATH,USER_INFO } from '@/store/mutation-types'
import { generateIndexRouter } from '@/utils/util'
import { menuPermission } from './utils/hasPermission'
import {loginIdmPlatform} from '@api/api'
import {loginIdmPlatform, getUserInfo} from '@api/api'
import {notification} from 'ant-design-vue'
import { filterTreeData, isExternalTerminal } from './utils/util'
@@ -21,17 +21,31 @@ router.beforeEach(async (to, from, next) => {
if (to.query.token) {
Vue.ls.set(ACCESS_TOKEN, to.query.token, 7 * 24 * 60 * 60 * 1000)
store.commit('SET_TOKEN', to.query.token)
// 通过token获取登录的用户信息
let userInfoFromUrlResult = await getUserInfo()
if(userInfoFromUrlResult.success) {
Vue.ls.set(USER_INFO, userInfoFromUrlResult.result , 7 * 24 * 60 * 60 * 1000)
store.commit('SET_INFO', userInfoFromUrlResult.result)
}
// 判断是否是会员系统iframe嵌入的,如果是 不先做左侧菜单和 头部标签
if(to.query.system === 'member') {
store.commit('SET_SYSTEM', to.query.system)
}
}
// idm系统单点登录
if(to.path === '/user/login' && to.query.code){
if(to.path === '/user/login' && to.query.code){
let result = await loginIdmPlatform({code:to.query.code})
if(result.success){
Vue.ls.set(USER_INFO, result.result.userInfo, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(ACCESS_TOKEN, result.result.token, 7 * 24 * 60 * 60 * 1000)
// TODO 判断当前用户是否是领导角色,如果是的话跳转到内网的网址的首页 并用token 登录
let userInfo = result.result.userInfo
const token = result.result.token
// 领导角色需要跳转到内网,
if(userInfo.roleCode.includes('bmfzr') || userInfo.roleCode.includes('sld') || userInfo.roleCode.includes('admin')) {
window.open(`${window._CONFIG.intranetUrl}dashboard/analysis?token=${token}`, '_self')
} else {
Vue.ls.set(USER_INFO, userInfo, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set(ACCESS_TOKEN, token, 7 * 24 * 60 * 60 * 1000)
}
}else {
notification['error']({
message: '登录失败',
@@ -92,7 +92,8 @@
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"
class="j-table-force-nowrap">
:class="dataSource.length === 0 ? 'show-scroll' : ''"
class="j-table-force-nowrap main-table">
<!-- 项目名称-->
<template slot="projectName" slot-scope="text, record">
@@ -107,6 +108,13 @@
</a-tooltip>
</template>
<template slot="allMoney" slot-scope="text">
<a-tooltip>
<template slot="title">{{ formatMoney(text+'') }}</template>
<div class="table-text">{{ formatMoney(text+'') }}</div>
</a-tooltip>
</template>
<!-- 打包需要发票到账开票邮寄状态-->
<template slot="status" slot-scope="text,record">
<status-slot :statu-obj="record" :status-no="text" :status-type="true"></status-slot>
@@ -139,6 +147,29 @@
<!--工作组项目普通项目资料网员项目可以修改发票信息-->
<a v-has="'packProject:changeInvoiceInfo'" @click="changeInvoiceInfo(record)" :disabled="Number(record.projectType) !== ProjectTypeEnums.GENERAL_PRO.value && Number(record.projectType) !== ProjectTypeEnums.GROUP_PRO.value && Number(record.projectType) !== ProjectTypeEnums.MEMBER_PRO.value">开票类型</a>
</span>
<template slot="footer" v-if="dataSource.length > 0">
<a-table
size="middle"
ref="footTable"
:rowKey="record=>record.id"
:columns="columnsFooter"
:scroll="{x: 1600}"
:dataSource="footerDataSource"
:showHeader="false"
:pagination="false"
class="j-table-force-nowrap footer-table">
<template slot="allMoney" slot-scope="text">
<a-tooltip>
<template slot="title">{{ formatMoney(text+'') }}</template>
<div class="table-text">{{ formatMoney(text+'') }}</div>
</a-tooltip>
</template>
</a-table>
</template>
</a-table>
</div>
<!-- /项目信息-->
@@ -222,6 +253,122 @@ import ConfirmStageModule from '../financialManagement/arriveAndInvoicing/module
import {getPayConfirmList} from '@/api/incomePaymentsApi'
import InvoiceInfoChangeModule from './modules/InvoiceInfoChangeModule'
import { ProjectTypeEnums } from '../../enums/commonEnums'
import { getAction } from '../../api/manage'
import { formatMoney } from '../../utils/formatMoney'
const firstColumnTop = {
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
}
const defaultTableColumns = [
{
title: '打包项目名称',
align: 'center',
width: 280,
dataIndex: 'chargeProject',
scopedSlots: { customRender: 'projectName' }
}, {
title: '项目负责人',
align: 'center',
width: 140,
dataIndex: 'principalName',
scopedSlots: { customRender: 'text' }
}, {
title: '待确收金额',
align: 'center',
width: 120,
dataIndex: 'receivableAmount',
scopedSlots: { customRender: 'allMoney' }
}, {
title: '实收金额',
align: 'center',
width: 120,
dataIndex: 'paidAmount',
scopedSlots: { customRender: 'allMoney' }
}, {
title: '打包',
align: 'center',
width: 80,
dataIndex: 'pack',
scopedSlots: { customRender: 'status-pack' }
}, {
title: '需要发票',
align: 'center',
width: 80,
dataIndex: 'needInvoice',
scopedSlots: { customRender: 'status-pack' }
}, {
title: '到账',
align: 'center',
width: 80,
dataIndex: 'inAccount',
scopedSlots: { customRender: 'status' }
}, {
title: '收入',
align: 'center',
width: 80,
dataIndex: 'affirmIncome',
scopedSlots: {customRender: 'status-confirm'}
}, {
title: '开票',
align: 'center',
width: 80,
dataIndex: 'makeInvoice',
scopedSlots: { customRender: 'status-bill' }
}, {
title: '邮寄',
align: 'center',
width: 80,
dataIndex: 'mail',
scopedSlots: { customRender: 'status-mail' }
}, {
title: '企业联系人',
align: 'center',
width: 100,
dataIndex: 'contactsTemporaryName',
scopedSlots: { customRender: 'text' }
}, {
title: '联系人电话',
align: 'center',
width: 100,
dataIndex: 'phone',
scopedSlots: { customRender: 'text' }
}, {
title: '联系人邮箱',
align: 'center',
width: 200,
dataIndex: 'email',
scopedSlots: { customRender: 'text' }
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 330,
scopedSlots: { customRender: 'action' }
}
]
const firstColumnFooter = [
{
title: '多选',
dataIndex: 'selection',
align: 'center',
width: 60
},
{
title: '序号',
dataIndex: 'title',
align: 'center',
width: 60
}
]
export default {
name: 'PackProjectMaintenance',
@@ -284,101 +431,8 @@ export default {
xs: { span: 24 },
sm: { span: 10 }
},
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
}, {
title: '打包项目名称',
align: 'center',
width: 280,
dataIndex: 'chargeProject',
scopedSlots: { customRender: 'projectName' }
}, {
title: '项目负责人',
align: 'center',
width: 140,
dataIndex: 'principalName',
scopedSlots: { customRender: 'text' }
}, {
title: '待确收金额',
align: 'center',
width: 120,
dataIndex: 'receivableAmount'
}, {
title: '实收金额',
align: 'center',
width: 120,
dataIndex: 'paidAmount'
}, {
title: '打包',
align: 'center',
width: 80,
dataIndex: 'pack',
scopedSlots: { customRender: 'status-pack' }
}, {
title: '需要发票',
align: 'center',
width: 80,
dataIndex: 'needInvoice',
scopedSlots: { customRender: 'status-pack' }
}, {
title: '到账',
align: 'center',
width: 80,
dataIndex: 'inAccount',
scopedSlots: { customRender: 'status' }
}, {
title: '收入',
align: 'center',
width: 80,
dataIndex: 'affirmIncome',
scopedSlots: {customRender: 'status-confirm'}
}, {
title: '开票',
align: 'center',
width: 80,
dataIndex: 'makeInvoice',
scopedSlots: { customRender: 'status-bill' }
}, {
title: '邮寄',
align: 'center',
width: 80,
dataIndex: 'mail',
scopedSlots: { customRender: 'status-mail' }
}, {
title: '企业联系人',
align: 'center',
width: 100,
dataIndex: 'contactsTemporaryName',
scopedSlots: { customRender: 'text' }
}, {
title: '联系人电话',
align: 'center',
width: 100,
dataIndex: 'phone',
scopedSlots: { customRender: 'text' }
}, {
title: '联系人邮箱',
align: 'center',
width: 200,
dataIndex: 'email',
scopedSlots: { customRender: 'text' }
}, {
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 330,
scopedSlots: { customRender: 'action' }
}
],
columns: [firstColumnTop, ...defaultTableColumns],
columnsFooter: [...firstColumnFooter, ...defaultTableColumns],
disableMixinCreated: true,
selectPackProjectVisible: false,
selectedProject: [], // 选中的项目
@@ -395,7 +449,8 @@ export default {
url: {
list: '/pack/payPackCompanyProject/listAll',
exportXlsUrl: '/pack/payPackCompanyProject/exportXls'
}
},
footerDataSource: []
}
},
created() {
@@ -405,6 +460,7 @@ export default {
})
},
methods: {
formatMoney,
getPayConfirmList,
/**
* 获取企业信息
@@ -624,8 +680,77 @@ export default {
// this.confirmStageVisible = true
this.$refs.changeInvoiceInfo.open(record)
},
/**
* 同步表与footer滚动,保留底部滚动条
*/
setScroll() {
if (this.dataSource.length === 0) {
return
}
let dom = this.$refs.footTable.$el.querySelectorAll('.ant-table-body')[0]
dom.addEventListener(
'scroll',
() => {
this.$refs.table.$el.querySelectorAll(
'.ant-table-body'
)[0].scrollLeft = dom.scrollLeft
},
true
)
this.$forceUpdate()
},
// 重写加载的方法
loadData(arg) {
if (!this.url.list) {
this.$message.error('请设置url.list属性!')
return
}
//加载数据 若传入参数1则加载第一页的内容
if (arg === 1) {
this.ipagination.current = 1
}
let params = this.getQueryParams()//查询条件
this.loading = true
getAction(this.url.list, params).then((res) => {
if (res.success) {
let pageListObj = res.result || {}
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
this.dataSource = pageListObj.list
let obj = {
id: '1',
title: '总计',
receivableAmount: pageListObj.sumOfReceivableAmount || '0.00' + '',
paidAmount: pageListObj.sumOfPaidAmount || '0.00' + ''
}
this.footerDataSource = [obj]
if (pageListObj.total) {
this.ipagination.total = pageListObj.total
//清空列表选中
this.onClearSelected()
} else {
this.ipagination.total = 0
}
//update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
}
if (this.dataSource.length > 0) {
this.$nextTick(() => {
this.setScroll()
})
}
if (res.code === 510) {
this.$message.warning(res.message)
}
this.loading = false
}).finally(() => {
this.loading = false
})
}
},
mounted() {
this.setScroll()
}
}
</script>
@@ -676,4 +801,47 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
</style>
// 隐藏主列表的横向滚动条
.main-table {
/deep/ .ant-table-body {
overflow-x: hidden !important;
}
/deep/ .ant-table-footer {
padding: 0 0;
}
/deep/ .ant-table.ant-table-bordered .ant-table-footer {
border-left: none;
margin-top: -2px;
}
}
.show-scroll {
/deep/ .ant-table-body {
overflow-x: auto !important;
}
}
// 去除底部表格边框
.footer-table {
/deep/ .ant-table-tbody > tr > td {
border: none;
background-color: #F5F5F5;
}
/deep/ .ant-table-fixed-right table {
border-left: none !important;
background: none;
}
/deep/ .ant-table-body {
overflow-x: auto !important;
}
/deep/ .ant-table-bordered .ant-table-header > table {
border-left: none;
}
}
</style>